ALL COVERED TOPICS

NoSQL Benchmarks NoSQL use cases NoSQL Videos NoSQL Hybrid Solutions NoSQL Presentations Big Data Hadoop MapReduce Pig Hive Flume Oozie Sqoop HDFS ZooKeeper Cascading Cascalog BigTable Cassandra HBase Hypertable Couchbase CouchDB MongoDB OrientDB RavenDB Jackrabbit Terrastore Amazon DynamoDB Redis Riak Project Voldemort Tokyo Cabinet Kyoto Cabinet memcached Amazon SimpleDB Datomic MemcacheDB M/DB GT.M Amazon Dynamo Dynomite Mnesia Yahoo! PNUTS/Sherpa Neo4j InfoGrid Sones GraphDB InfiniteGraph AllegroGraph MarkLogic Clustrix CouchDB Case Studies MongoDB Case Studies NoSQL at Adobe NoSQL at Facebook NoSQL at Twitter

NAVIGATE MAIN CATEGORIES

Close

MongoDB Tricks: BSON Objects are Order-Prserving

Caught this one on the MongoDB mailinglist: BSON objects are preserving the order of the attributes, so the following behavior is expected:

db.test.save( {-id: {a:1, b:2}} )
db.test.find( {-id: {a:1, b:2}} ) // returns { "-id" : { "a" : 1, "b" : 2 } }
db.test.find( {-id: {b:2, a:1}} ) // nothing has been found

Original title and link: MongoDB Tricks: BSON Objects are Order-Prserving (NoSQL databases © myNoSQL)