Skip to content


Subversion checkout URL

You can clone with
Download ZIP


No #584

stuartmemo opened this Issue · 7 comments

7 participants


Apologies if there's a reason this isn't included, but I'd like to see MongoDB's save method (insert/update combined) available in Meteor.



Hey Stuart, supporting save() is a good idea. Originally we didn't do it because save() requires the upsert to update(), which we currently don't support. (In an upsert, the database sometimes has to autogenerate an _id. That's a problem for apps that want to use strings for _ids instead of ObjectIds for _ids, which is most Meteor apps. Also, in Meteor, the _id for inserts is chosen by the client so that you can have it immediately without waiting for a round trip.)

But, good news. We just spent a while thinking about save() and realized that even though it depends on upsert, it can never result in the server autogenerating an _id, because it only does an upsert when the _id is already known. And, while thinking about that, we realized that upsert itself could be implemented (reasonably efficiently, even) by using a Mongo server-side eval. So we plan to do both of these things, but it could be a few months until we get to it because we're just swamped right now. Though we would take pull requests (from someone who understands how the insert/update path works well enough to fit it in correctly next to the other operations.)

Anyway, thanks a lot for filing this and getting us thinking about these subjects. It would be really cool to finally get upsert implemented.


Really really cool. :+1:


Is support for save() still in the cards?


I've also felt the need for .save() quite often.


We do not use GitHub to track feature requests (other than for Blaze). The core team's current roadmap is at Discussions about features that users desire are great topics for the meteor-talk mailing list, where the community can help come up with solutions that don't require core changes.

@glasser glasser closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.