问题描述:

I am using mongo replicaset through my meteor app.

Here is my connection string and code:

var collectionsDB = new MongoInternals.RemoteCollectionDriver("mongodb://usr:[email protected]:27017,user:[email protected]:27017,use:[email protected]:27017/myDB?replicaSet=myRelicaset&authSource=myDB&readPreference=primaryPreferred&w=1");

coll = new Mongo.Collection('<myCollection>',{ _driver:collectionsDB });

Problem:

When I am trying to insert to mongoDB, it tries to insert into Admin db rather myDB. The user usr has readwrite permission for myDB. I fail to understand why it is targeting Admin. As it does not have permission in Admin it through permission error.

However it works fine for individual mongo server without replicaset.

Any thing I am missing in connection string?

thanks

Nihar

相关阅读:
Top