[SERVER-46055] Error: the update operation document must contain atomic operators Created: 10/Feb/20 Updated: 27/Oct/23 Resolved: 24/Feb/20 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Write Ops |
| Affects Version/s: | 4.2.0 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | srinivas yalamanchili | Assignee: | Dmitry Agranat |
| Resolution: | Works as Designed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Attachments: |
|
|||||||||||
| Backwards Compatibility: | Fully Compatible | |||||||||||
| Operating System: | ALL | |||||||||||
| Steps To Reproduce: | Was testing for something & found this issue, So tried to execute what's given in documentation https://docs.mongodb.com/manual/reference/method/db.collection.updateMany/index.html#examples So when executing aggregation pipeline in updateMany() getting this error every time on v4.2, Tried this on robo3T & mongo shell result is same. Query : (Same as given in documentation)
Insert :
db.members.insertMany([
Update :
Working code (works with update) :
|
|||||||||||
| Participants: |
| Description |
|
Getting 'Error: the update operation document must contain atomic operators' when executing aggregation pipeline thru .updateMany() on v4.2 |
| Comments |
| Comment by srinivas yalamanchili [ 11/Feb/20 ] |
|
@Dmitry Agranat : Ohh I've missed it, Yes I was using v`4.0.10` that seems to be an issue, with shell v`4.2` it's working fine. But what's weird is new `.update()` with aggregation pipeline does work with old shell (Vs) `.updateMany()` doesn't. Anyway thanks for help..
|
| Comment by Dmitry Agranat [ 11/Feb/20 ] |
|
Hi vtxn0504@gmail.com, I was able to reproduce this issue when using an older mongo shell version, with mongo shell 4.2 everything works fine. Can you try mongo shell 4.2 and let us know if everything works as expected? |
| Comment by srinivas yalamanchili [ 10/Feb/20 ] |
|
@Dmitry Agranat : I'm getting same result with shell as well robo3T, Tried exactly the same thing what's given in documentation, Here is an image of my shell output..
|
| Comment by Dmitry Agranat [ 10/Feb/20 ] |
|
Could you please provide mongod log as well as mongo shell output when executing these commands with mongo shell (not with robo3T)? Regards, |