Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Insert/Upsert to a Meteor Collection with Unacknowldeged Write Concern

In Meteor, how do you Insert/Upsert to a Meteor Collection with Unacknowldeged Write Concern w=0?

Can the write concern be set during the insert/upsert, rather than as a environment variable?

like image 534
Nyxynyx Avatar asked Jan 17 '14 15:01

Nyxynyx


1 Answers

Yes, you can pass writeConcern as of Mongo v2.6:

http://docs.mongodb.org/manual/reference/command/insert/#dbcmd.insert

No, you can't pass that option in Meteor. It's not documented here:

http://docs.meteor.com/#update

I did some digging to see what you'd have to do if you wanted to patch Meteor. Here is the link to their update/insert/upsert code:

https://github.com/meteor/meteor/blob/devel/packages/mongo/collection.js

It looks like it delegates to DDP which is their Distributed Data Persistence framework. Hope that helps.

like image 103
Matt Avatar answered Oct 18 '22 21:10

Matt