Last active
December 18, 2015 01:49
-
-
Save arthurnn/5706565 to your computer and use it in GitHub Desktop.
mongodb ordered sub-doc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use test | |
db.entities.drop() | |
db.entities.insert({_id: 1}) | |
db.entities.update({ "_id": 1 }, {"$set": {"foo": "foo"} }) | |
db.entities.update({ "_id": 1 }, {"$set": {"a": "a"} }) | |
db.entities.update({ "_id": 1 }, {"$set": {"c": "c"} }) | |
db.entities.update({ "_id": 1 }, {"$set": {"b": "b"} }) | |
db.entities.find() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment