Reputation: 986
Here's a sample of my MongoDB documents:
{
"_id" : ObjectId("59caa2660aaafa0016344ce0"),
"field1" : true,
"field2" : false
}
{
"_id" : ObjectId("59caa2690aaafa0016344ce1"),
"field1" : false,
"field2" : false
}
{
"_id" : ObjectId("59caa26c0aaafa0016344ce2"),
"field1" : false,
"field2" : true
}
How do I match all documents that have the value of field1
OR the value of field2
OR both field1
and field2
set to true?
In other words, I want to exclude documents where field1
and field2
both are false.
Upvotes: 2
Views: 98