Giter Club home page Giter Club logo

Comments (3)

TonyLuo avatar TonyLuo commented on June 14, 2024

it works well on loopback-connector-mysql version: 1.7.0

from loopback-connector-mysql.

erikverheij avatar erikverheij commented on June 14, 2024

I've a similar problem;

var filter = {
  where: { userId: userId},
  include: {
    relation: 'challenger',
    scope: {
      include: {
        relation: 'leagues',
        scope: {
          where: { id: 1 }
        }
      }
    }
  }
};

results in

sql: 'SELECT `id`, `name` FROM `League` WHERE `id` IN (3,4,5,6) ORDER BY `id`'

In my case the WHERE id=1 part is missing. I think this is because it has been overridden by the WHERE id IN part which is required for the include relation.

from loopback-connector-mysql.

jannyHou avatar jannyHou commented on June 14, 2024

@TonyLuo If the problem is "scope filter" is applied on throughModel not relatedModel, I believe it's fixed in loopbackio/loopback-datasource-juggler#1153, the fix is on 3.x version but hasn't beed backported to 2.x(under discussion)

If that is not the case, can you fork https://github.com/strongloop/loopback-sandbox and replace with your use case? Thanks. I will try to reproduce it.

from loopback-connector-mysql.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.