MongoDB - Find documents matching certain condition for unknown field keys
问题 How can I query a MongoDB collection to find documents with a structure as below? The documents have a field called thing which is a subdocument, and the keys for this field are a form of ID number which will generally not be known by the person writing the query (making dot notation difficult and I assume impossible). { "_id" : 3, "_id2" : 234, "thing": { "2340945683": {"attribute1": "typeA", "attribute2": "typeB", "attribute3": "typeA" }, "349687346": {"attribute1": "typeC", "attribute2":