-
Type:
Bug
-
Resolution: Done
-
Priority:
Minor - P4
-
None
-
Affects Version/s: 1.6.4
-
Component/s: Usability
-
None
-
Environment:OS: Debian x64
-
ALL
-
None
-
3
-
None
-
None
-
None
-
None
-
None
-
None
During the past week I have started getting this error when performing
an update in Mongo. This was a working query and now it fails.
> db.mycollection.update(
{ "a.b" : 665 }, { $pop : { "c" :
{ "d" : 1153 }} });
"can't apply mod in place - shouldn't have gotten here"
mongo.log shows the following
"Tue Dec 7 16:10:12 [conn4] update liststore.individuals query:
exception 10144 can't apply mod in place - shouldn't
have gotten here 0ms"
"a.b" is an indexed long
"c" is a collection containing an array
"d" is a field for each document within "c"
OS: Debian x64
Mongo: 1.6.4
Answer: Turns out that $pull, should be used instead of $pop.
The error message was not clear and could use a little attention