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

$lt null returns true #23

Closed
KamalAman opened this issue Apr 12, 2016 · 1 comment
Closed

$lt null returns true #23

KamalAman opened this issue Apr 12, 2016 · 1 comment
Labels

Comments

@KamalAman
Copy link

When querying with $lt or $lte, underscore-query returns true for null values.

In javascript:

var a = {test: null};
a.test < 1 == true,

However in mongo:

db.col.insert({"test": null})
//WriteResult({ "nInserted" : 1 })
db.col.find({"test": {$lt: 1}}).count()
//0

@megawac megawac added the bug label Apr 12, 2016
@megawac
Copy link
Collaborator

megawac commented Apr 12, 2016

Interestingly mongodb doesn't do this with $mod and will treat null as 0 in this case

ticket

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

No branches or pull requests

2 participants