Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

scan().limit() return 0 Count and items #221

Open
jasmo2 opened this issue Aug 31, 2017 · 1 comment
Open

scan().limit() return 0 Count and items #221

jasmo2 opened this issue Aug 31, 2017 · 1 comment

Comments

@jasmo2
Copy link

jasmo2 commented Aug 31, 2017

If i used volges Model.scan().loadAll() I get 47 results in dev, but if i try to use it with Model.scan().limit(3) I get zero. What could be wrong?

with loadAll()

Count:48
Items:Array[48] [Model, Model, Model …]
LastEvaluatedKey:Object {id: "d95cac31-b4b3-405a-a057-8b42e6706788"}
ScannedCount:48

with limit()

{
  Items: [],
  Count: 0,
  ScannedCount: 48,
  LastEvaluatedKey: { id: '7c77d02c-c315-44c2-9bb6-98d7dae65aca' } 
}
@avtaniket
Copy link

@jasmo2 see the difference

// scan all accounts, this time loading all results 
Account
  .scan()
  .loadAll()
  .exec(callback);

and

// Load 20 accounts 
Account
  .scan()
  .limit(20)
  .exec();

and

// Load All accounts, 20 at a time per request 
Account
  .scan()
  .limit(20)
  .loadAll()
  .exec()

Are you using extra filter queries? that can also limit your scan result to empty

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants