loopback icon indicating copy to clipboard operation
loopback copied to clipboard

Limit filter on included models results in unexpected output

Open achintverma opened this issue 10 years ago • 7 comments

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 avatar Jul 20 '16 19:07 achintverma

BTW, connector is MongoDB

achintverma avatar Jul 20 '16 19:07 achintverma

+1

ron137 avatar Sep 14 '16 08:09 ron137

@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.

jannyHou avatar Sep 14 '16 16:09 jannyHou

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

loay avatar Jan 30 '17 20:01 loay

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] avatar Aug 23 '17 15:08 stale[bot]

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.

stale[bot] avatar Sep 06 '17 15:09 stale[bot]

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

achintverma avatar Sep 06 '17 15:09 achintverma