[SERVER-11384] bad error message when attempting to $pop from a non-array field Created: 25/Oct/13  Updated: 11/Jul/16  Resolved: 04/Dec/13

Status: Closed
Project: Core Server
Component/s: Write Ops
Affects Version/s: 2.5.3
Fix Version/s: 2.5.5

Type: Bug Priority: Minor - P4
Reporter: David Storch Assignee: Scott Hernandez (Inactive)
Resolution: Done Votes: 0
Labels: 26qa
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Gantt Dependency
Operating System: ALL
Participants:

 Description   

Here is the error string that an update with $pop returns if the field we try to pop from is not an array:

> db.x.drop()
true
> db.x.save({_id: NumberInt(3), a: 1})
> db.x.update({}, {$pop: {a: 1}})
Can only $pop from arrays. INVALID-MUTABLE-ELEMENT has the field a of non-array type NumberDouble

The problem is that INVALID-MUTABLE-ELEMENT is displayed instead of properly printing the _id of the document on which the update failed.



 Comments   
Comment by Githook User [ 04/Dec/13 ]

Author:

{u'username': u'scotthernandez', u'name': u'Scott Hernandez', u'email': u'scotthernandez@gmail.com'}

Message: SERVER-11188, SERVER-11366, SERVER-11384, SERVER-11623: Update message cleanup
Branch: master
https://github.com/mongodb/mongo/commit/a523a77c9601d3d8c1bd6175ead83702b95409b9

Generated at Thu Feb 08 03:25:39 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.