-
Notifications
You must be signed in to change notification settings - Fork 371
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"Unknown modifier: $pushAll" #17
Comments
I see there is an open PR with this fix already |
I stucked with this error for an hour and finally it was pretty simple. You just need to update the schema :
And change addLyric
|
@PostIt59 👍 Thanks for the effort but do note that there is a small typo. Instead of |
I had the same problem! What i Did was I added the option to the song schema usePushEach with the value true const SongSchema = new Schema({
title: { type: String },
user: {
type: Schema.Types.ObjectId,
ref: 'user'
},
lyrics: [{
type: Schema.Types.ObjectId,
ref: 'lyric'
}]
}, {
usePushEach : true
}); |
Another solution being floated in the Q & A section of Stephen's course is to upgrade our Mongoose version.
Several people (myself included) have reported success with this. Q & A Post (requires Udemy login): |
Automattic/mongoose#5924 (comment) In server/models/song.js just add:
after
and everything works. |
Thank's man. It Solved a big issue on my app |
can we have pull request for this merged .. please |
When using mutating with
addLyricToSong
like the following query:you run in the following error:
This problem is reported here: Automattic/mongoose#5574.
I will make a PR with the fix
The text was updated successfully, but these errors were encountered: