Order of key values in mongoDb [duplicate]
Clash Royale CLAN TAG #URR8PPP Order of key values in mongoDb [duplicate] This question already has an answer here: mongo code : db.temperature.insert({"x":3,"y":4}); db.temperature.find(); OUTPUT { "_id" : ObjectId("52b418fb132c1f3236831447"), "y" : 4, "x" : 3 } Please help me to understand why in my case(above.) The find method is showing Y value first and x value later even when while inserting the order is different. Appreciate any help. This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question. 1 Answer 1 Quoting https://stackoverflow.com/a/6453755/1150636 Both document structure and collection structure in MongoDB based on JSON principles. JSON is a set of key/value pairs (in particular fieldName/fieldValue for document and index/document for collectio...