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

There's no Easy way to check that an array exists and has length #25

Open
neilbaylorrulez opened this issue Jul 12, 2013 · 1 comment
Open

Comments

@neilbaylorrulez
Copy link

This is how I currently query to find a non empty array

collection
        .findAll({
            theArray: {$exists: true},
            $not: {theArray: $length: 0}
        })

It would be great if there was another way to do this or atleast some syntactic sugar that would let me do something like:

collection
        .findAll({
            theArray: $gt: 0
        })

or maybe

collection
        .findAll({
            theArray: $length: $gt: 0
        })
@balupton
Copy link
Member

This is a great idea. I'll happily accept pull requests for this.

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