We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I'll let the code do the talking. Here is a shortened version for testing:
var child = new mongoose.Schema({ item2: { item3: String, item4: String, }, }); var parent = new mongoose.Schema({ name: String, item1: child, }); var Parent = mongoose.model('Parent', parent) mongoose.connect('mongodb://localhost/tmp', function(err) { Promise.resolve(Parent.create({ 'name': 'The first of its kind', })) .then(function(doc) { return doc.update({ 'item1.item2': { 'item3': 'Test1', 'item4': 'Test2', }, }); }) .then(function(data) { console.log(data) // { ok: 0, n: 0, nModified: 0 } }) });
If doc.update() is changed to something like below, then all goes according to plan.
doc.update()
return doc.update({ 'item1.item2.item3': 'Test1', 'item1.item2.item4': 'Test2', });
Node: v5.5.0 Mongo: 3.2.0 Mongoose: 4.3.7 Time to find issue: > 3 hours
v5.5.0
3.2.0
4.3.7
> 3 hours
The text was updated successfully, but these errors were encountered:
I realize that according to mongodb, you have to use dot notation for this, but it would be nice if mongoose would convert it to dot notation for you.
Sorry, something went wrong.
test(query): repro #3820
0aeb671
e192865
No branches or pull requests
I'll let the code do the talking. Here is a shortened version for testing:
If
doc.update()
is changed to something like below, then all goes according to plan.Node:
v5.5.0
Mongo:
3.2.0
Mongoose:
4.3.7
Time to find issue:
> 3 hours
The text was updated successfully, but these errors were encountered: