I'm using $match of aggregation. and I tried this.
$match : {
$not: {
'A': false,
'B': 'condition'
}
}
but not work like nand. it works like not A and not B. How can I query with Not(A and B) ?
I'm using $match of aggregation. and I tried this.
$match : {
$not: {
'A': false,
'B': 'condition'
}
}
but not work like nand. it works like not A and not B. How can I query with Not(A and B) ?
This should fetch you the results
{
$or: [
{'a': { $ne: 1} },
{'b': { $ne: 2} }
]
}
However, this expression did not yield the desired result in my case so I tried this-
{
$nor: [
{
$and: [
{a: 1},
{b: 2}
]
}
]
}