Details
-
Bug
-
Resolution: Done
-
Major - P3
-
None
-
None
-
None
-
ALL
Description
The code for detecting conflicting mods does not always detect conflicting mods. In cases where conflicting mods are not detected, the update implementation does not handle the conflicting mods properly and can create a document with duplicate field names.
Test
c = db.c;
|
c.drop();
|
|
|
c.save( {} );
|
|
|
// This triggers an error.
|
c.update( {}, { $set:{ 'a.b':2, 'a.b.c':3 } } );
|
printjson( db.getLastError() );
|
|
|
// This generates { a:{ a:1, b:2, b:2 } }.
|
c.update( {}, { $set:{ 'a.a':1, 'a.b':2, 'a.b.c':3 } } );
|
printjson( db.getLastError() );
|
printjson( c.find().toArray() );
|
See ModSet::haveConflictingMod().
Attachments
Issue Links
- related to
-
SERVER-6399 Refactor update() code
-
- Closed
-