How do I do a search in MongoDB that searches for any documents with a given property?
What I want to do is find all the documents that have the property regardless of it's value and I don't seem to be able to do this. I've tried the following
db.collection.find({"property", null}); //Finds things that don't have that property
db.collection.find({"proprety", {}}); //Doesn't find anything unless something has the empty object as the value
Is there actually a syntax for this or would I need to do a mapreduce operation?