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

limit #187

Open
Grandiz opened this issue Aug 24, 2016 · 1 comment
Open

limit #187

Grandiz opened this issue Aug 24, 2016 · 1 comment

Comments

@Grandiz
Copy link

Grandiz commented Aug 24, 2016

Here is my query:

var scan = Message
                        .scan()
                        .filterExpression('#sender = :userId OR #recipient = :userId')
                        .expressionAttributeValues({':userId': userId})
                        .expressionAttributeNames({'#sender': 'sender', '#recipient': 'recipient'});

                    if (paginationLimit != 0) {
                        scan.limit(paginationLimit);
                    }

                    if (e.params.querystring.startKey) {
                        scan.startKey(e.params.querystring.startKey);
                    }
                    scan.exec(finish);

The result is Count: 2, ScannedCount: 10. But in table i have 3 entity with same userId as i passed.
Scan below return Count: 3

Message
                        .scan()
                        .filterExpression('#sender = :userId OR #recipient = :userId')
                        .expressionAttributeValues({':userId': userId})
                        .expressionAttributeNames({'#sender': 'sender', '#recipient': 'recipient'})
                        .select('COUNT')
                        .exec(finish);

Could any one help me?

@clarkie
Copy link

clarkie commented Sep 6, 2016

This question is answered over in dynogels (a fork of vogels): clarkie/dynogels#12

tl;dr - it's expected behaviour.

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