If my stored document looks like this:
doc = {
'Things' : [ 'one' , 'two' , 'three' ]
}
How can I query for documents which contain one in Things?
I know the $in operator queries a document item against a list, but this is kind of the reverse. Any help would be awesome.
Use MongoDB’s multikeys support:
Basically, you don’t have to worry about the array-ness of
Things, MongoDB will take care of that for you; something like this in the MongoDB shell would work: