What\'s a good way to store a set of documents in MongoDB where order is important? I need to easily insert documents at an arbitrary position and possibly reorder them lat
For abitrary sorting of any collection, you'll need a field to sort it on. I call mine "sequence".
schema: { _id: ObjectID, sequence: Number, ... } db.items.ensureIndex({sequence:1}); db.items.find().sort({sequence:1})