strongloop / loopback

LoopBack makes it easy to build modern applications that require complex integrations.
http://loopback.io
Other
13.23k stars 1.2k forks source link

Limit filter on included models results in unexpected output #2524

Closed achintverma closed 7 years ago

achintverma commented 8 years ago

Assume there are two models Account and Listing. I want to pull accounts with 5 listings from each account. When make a REST call as follows:

Account.find({
     where:{
        state: 'CA'
      },
      include: {
         relation: 'listing',
         scope:{
           limit: 5
         }
     }
});

It gives result with No Listings in few accounts but in reality there are listings under each user

achintverma commented 8 years ago

BTW, connector is MongoDB

ron137 commented 8 years ago

+1

jannyHou commented 8 years ago

@achintverma @ron137 Can you fork https://github.com/strongloop/loopback-sandbox and replace it with your code?

result with No Listings in few accounts

This makes it hard for me to reproduce your problem if it doesn't happen in all instances. Thanks.

loay commented 7 years ago

Hi @achintverma Can you please provide a sample repo so we can debug the issue? Thanks.

stale[bot] commented 7 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] commented 7 years ago

This issue has been closed due to continued inactivity. Thank you for your understanding. If you believe this to be in error, please contact one of the code owners, listed in the CODEOWNERS file at the top-level of this repository.

achintverma commented 7 years ago

Apologies for the late response. For some reason, I didn't get any email notification for all other activities except the closure today.