It turns out that we have duplicate data. Here what's the test case stores:
> db.command.find().pretty() { "_id" : "-2073772383", "name" : "other", "products" : [ { "price" : 10, "name" : "P1", "products_ORDER" : 0 }
, { "price" : 15, "name" : "P2", "products_ORDER" : 1 }
, { "price" : 20, "name" : "P1", "products_ORDER" : 0 }
] }
As you can see "products_ORDER : 0" is stored twice.
|