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
Cannot update embedded documents #261
Comments
Same issue ... please fix it :) http://groups.google.com/group/mongoose-orm/browse_thread/thread/40c9a9d53f4c41c4 |
ok, we hve not the same issue: now I know what the problem is: you can't update schemafree embedded documents! Here is a clear example how to reproduce it: https://gist.github.com/845258 run this: this will create data in the db
go then to mongo shell:
this should modify the data
The question now is it an issue or a missing feature? |
+1'ing this issue. It seems to be occurring with the Number type at least, even on the main document (not just embedded). Would be awesome if someone at least has a workaround at least for the moment. [Edit] Doesn't seem to happen with strings. Only Numbers. |
This is a missing feature -- i.e., being able to call save directly on an embedded document. I'm going to add this as a separate issue.
embedded.save(function(err) { //o.save makes no difference to o.save(function(err) { //o.save makes no difference @rakeshpai Not sure what you mean. Can you review my comments, and let me know if you are still having an issue? If you still are, please be descriptive and attach an example or gist to your reply. |
Sorry for the delayed response. I discovered that my problem is a dupe of #342 |
@bnoguchi do you mean that this issue is because 'a single instantiated document only be able to update its embedded documents once'? is the latest version of mongoose fixed this issue ? |
I can't find any way to update the contents of an embedded document once it's been saved. I've tried modifying the embedded doc and saving the parent.. saving the embedded doc itself, etc.. Nothing works. Here's some code to reproduce:
The text was updated successfully, but these errors were encountered: