How to solve the “Unknown modifier: $pushAll” error in Mongoose
1 min readJan 8, 2018
I got this error message while building up a Mongoose schema:
MongoError: Unknown modifier: $pushAll
The solution wasn’t the typical “google error message and copy/paste from stack overflow”, but it was fairly simple once I found the working solution.
You simply just have to add a settings object containingusePushEach: true.
new mongoose.Schema({
username: String
}, {
usePushEach: true
});