Details
-
Type:
Improvement
-
Status:
Resolved
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 1.0.0ALPHA1, 1.0.0ALPHA2, 1.0.0BETA1
-
Fix Version/s: 1.0.0BETA2
-
Component/s: Persister
-
Labels:None
Description
Order of keys in embedded bson hashes in mongodb matters, so you can't $pullAll an embedded document if the order of keys is different from the one in mongodb:
code
{
_id: ObjectId('123'),
addresses: [
,
,
]
}
/code
then query like:
code
db.collection.update({_id: ObjectId('123')}, {$pullAll: {addresses: [
]}})
/code
would fail, because the order of keys ('zipCode', 'street') is different from the one stored in mongo ('street', 'zipCode'). More can be found here http://jira.mongodb.org/browse/SERVER-1914
Therefore, we need to force the order on every insert and update for consistency.
This is not a problem anymore after the recent refactoring!