Skip to content
New issue

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

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

Already on GitHub? # to your account

RegEx ID #2

Open
alabotski opened this issue Dec 14, 2017 · 0 comments
Open

RegEx ID #2

alabotski opened this issue Dec 14, 2017 · 0 comments

Comments

@alabotski
Copy link

alabotski commented Dec 14, 2017

Can you add support find by _ID

For example I use string

name=like=c7c502,id=like=c7c502,imei=like=c7c502,location=like=c7c502

So query, dont' work

db.groupEntity.find({ "$or" : [ { "name" : { "$regex" : "c7c502" , "$options" : "is"}} , { "id" : { "$regex" : "c7c502" , "$options" : "is"}} , { "imei" : { "$regex" : "c7c502" , "$options" : "is"}} , { "location" : { "$regex" : "c7c502" , "$options" : "is"}}]})

But such query work well

db.groupEntity.find({ "$or" : [ { "name" : { "$regex" : "c7c502" , "$options" : "is"}} , {"$where" : "/c7c502/.test(this._id)"} , { "imei" : { "$regex" : "c7c502" , "$options" : "is"}} , { "location" : { "$regex" : "c7c502" , "$options" : "is"}}]})

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

No branches or pull requests

1 participant