Solvedmongoose Saving a model fails with mongo error: MongoError: Unknown modifier: $pushAll
✔️Accepted Answer
Well that's one problem, mongodb 3.5 is an unstable dev release and should not be used. $pushAll has been deprecated for a long time so perhaps they got rid of it in 3.5. @mbroadst can you clarify?
We added a usePushEach
option to work around this a while back: #4455 , that should be a workaround for this issue:
new Schema({ arr: [String] }, { usePushEach: true });
Other Answers:
@vkarpov15 Thanks for the fantastic library sir.
I, too, anm experiencing this issue with Mongoose 4.13.7 and MongoDB 3.6.0.
UPDATE: Adding usePushEach: true
to schema options for models resolved this.
@rivers-lis You have to add usePushEach
to the schema options, not to the schema, like so:
new Schema({ ... }, { usePushEach: true });
Mongoose 5 should not be affected by this issue, it doesn't use $pushAll
anywhere. If you get this error with mongoose 5, please open up an issue with code samples
@rankitbishnoi You can get around this temporarily by adding the usePushEach
option on each schema definition in the options.
Do you want to request a feature or report a bug?
Report a bug
What is the current behavior?
Test passing on local machine but failing on jenkins server with the exact same versions. The only difference is local is macos and jenkins is ubuntu as far as I can tell.
On MacOS Sierra, node 8.4 and 7.11, mongodb 3.4.7, and mongoose 4.11.7 the following test passes, but on our jenkins server with the exact same versions on an ubuntu 16.04 server fails.
Here is the exact error that i'm getting:
edit: Here is a more readable version of the stack trace