I want to bitwise check in my data, but not return data.Rights default param is 1. How do I solve this problem?
db.getCollection('forms').find(
{
"IsActive" : true,
"$or" :
[
{ "$where" : "(this.Acls.Rights & 1) == 1" , "Acls.Actor._id" : ObjectId("5565f392a6df191eb4689bec") },
{ "$where" : "(this.Acls.Rights & 1) == 1" , "Acls.Actor._id" : ObjectId("5565f392a6df191eb4689bed") }
]
}
)
Here is a document I expect to match:
{
"_id" : ObjectId("55686c44a6df1a1008c0b148"),
"IsActive" : true,
"Acls" : [
{
"_id" : ObjectId("557820b1a6df1a032c2c643a"),
"IsActive" : true,
"Actor" : {
"_id" : ObjectId("5565f392a6df191eb4689bec"),
"IsActive" : true,
"Name" : "admin",
"TypeId" : 2
},
"Department" : null,
"Rights" : NumberLong(1)
}
],
"AclCount" : 1
}