-
-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
$rename throws cast error #1845
Milestone
Comments
Apparently, var mongoose = require('mongoose'),
User = mongoose.model('User', new mongoose.Schema({
cool: Boolean
}));
User.update({}, {
$rename: {
cool: 'awesome'
}
}, function (err) {
console.log(err.stack);
}); It failed for me in
|
It also seems to fail in [email protected] Order.update({
ETA: {
$ne: null
}
}, {
$rename: {
ETA: 'deliveryETA'
}
}, {
multi: true
}, done)
Using Is this intended? If yes, mongoose may want to warn about this in the docs. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hello!
When I try to do simple $rename update I get "Cast to number error".
Photo.update({r2: 167}, {$rename: {r2: 'r1'}}, {multi: true})
But if I do this through Model.collection.update or through mongo console all ok.
Photo.collection.update({r2: 167}, {$rename: {r2: 'r1'}}, {multi: true})
The text was updated successfully, but these errors were encountered: