-
Type: Bug
-
Resolution: Duplicate
-
Priority: Major - P3
-
None
-
Affects Version/s: 2.6.2
-
Component/s: None
-
None
-
ALL
-
Read Steps To Reproduce first.
I think findAndModify with upsert flag in case the object is not found, uses the query as the schema of the object. Query like:
makes Mongodb thinks emails field contain string (although the collection is empty). While query like {$elemMatch: { $regex: 'test@gmail.com', $options: 'i' }} works just fine.
I tested only on v2.6.2
Note: Replacing $addToSet with $push, results in the same issues.
- duplicates
-
SERVER-3946 Update with $addToSet/$push with a query on same field is broken during insert
- Closed