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

$in differ from mongo #196

Closed
Eomm opened this issue May 15, 2020 · 1 comment
Closed

$in differ from mongo #196

Eomm opened this issue May 15, 2020 · 1 comment

Comments

@Eomm
Copy link

Eomm commented May 15, 2020

Hello,
I'm experiencing this issue with sift@12.0.1 when performing and $in condition:

It seems that ['A', 'B'] match with the [] case.

const sift = require('sift')

const filter = {
  Demo: { $in: [null, [], 'C'] }
}

const fun = sift(filter)

console.log(fun({ Demo: ['A', 'B'] })) // should be false but it return true
console.log(fun({ Demo: null })) // true is ok
console.log(fun({ Demo: [] })) // true is ok
console.log(fun({ Demo: ['C'] })) // true is ok

I have tried it against Mongo 4.2.0 and the document doesn't match

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