MongoDb select different object types in collection -
I have a MongoDB archive that the user says I do not know the type of object in advance, at least 3 of the objects in this collection There are different types of structured. For example:
Type 1:
{"_id": "9e1736d4-f3a1-47ed-bb51-3318129664f0", "UserID": 6711, "Register Date ":" 2014-10-28 T 14: 42: 06 "," Final Legend ":" 2014-10-28 T 14: 42: 06 ",}
Type 2:
{"_id": "9e1736d4-f3a1-47ed-bb51-3318129664f1", "userid": 6712, "email": "johndoe@example.com", "username": "John Doe",
Type 3:
{"_id": "9e1736d4-f3a1-47ed-bb51-3318129664f2", "userid": 63713, "City": "How can I get different types (or the top 1 object of each type) from my collection?" Orange "," state ":" new york "," "If you have 1 million users and 3 different structures, then I have to get 3 results."
Add the type of document type of document type "type" and then use it for your group's results on your wishes.
< / Div>
Comments
Post a Comment