How to set mongodb 'read concern' in a Meteor app?


#1

In a Meteor app, how should the MongoDB read concern be set? I would like to set this flag on a case-by-case basis (not at the connection level).

I have been unable to answer this question using Google. A pointer to the appropriate documentation may be all I need.

‘Read concern’ is described here: https://docs.mongodb.com/manual/reference/read-concern/.

I don’t see anything like this in the Meteor docs: https://docs.meteor.com/api/collections.html

Any help is appreciated.

L


#2

You may find something useful with rawDatabase.


#3

Or with Mongo.Collection#rawCollection

Give it a test and let us know if it works


#4

We set readPreference in the MONGO_URL, so I would think that you could do the same with readConcern.

Our MONGO_URL looks like:

"mongodb://user:password@host1,host2/database?replicaSet=rsname&ssl=true&readPreference=primaryPreferred&authSource=admin"