I am trying to perform a bitwise check on my data without returning any data. The default value for Rights parameter is 1. How can I resolve this issue?
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") }
]
}
)
Below is the document that should 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
}