Oh, if found the solution for this problem,
The following query makes the NAND effect:
child.find({
$or:[
{"id.grandParent": {$ne: "3"}},
{"id.parent" : {$ne: "2"}},
{"id.child" : {$ne: "0"}}
]
});
So what im doing here is finding all children that has at least one of the 3 statements true.
Each statement will return true when its not equal to resp. 3, 2 or 0. So the only document that will return false (and thus be excluded) in this or statement will be documents that have all of them equal to 3, 2 and 0.
I hope someone else finds this NAND operator useful
Hylke Bron