草庐IT

RemoteCollectionDriver

全部标签

mongodb - Meteor 确实看到了一个带有 MongoInternals.RemoteCollectionDriver 的远程 mongodb 实例

我在使用带有新meteor1.3的远程mongodb时遇到问题vard=newMongoInternals.RemoteCollectionDriver("");C=newMongo.Collection("",{_driver:d});我是这样放在收藏夹里的if(Meteor.isServer){vardriver=newMongoInternals.RemoteCollectionDriver("mongodb://user:password@localhost:27017/customCollec");}C=newMongo.Collection("customCollec",{

mongodb - 在 Meteor.js 中,使用多个具有相同集合名称的 MongoInternals.RemoteCollectionDriver

MongoInternals.RemoteCollectionDriver("mongodb://#{server.ip}:#{server.port}/#{server.dbName}")如果我调用多个远程MongoDB方法并且如果有同名的集合,Meteor会抛出类似这样的错误,“collectionName/insertisalreadyexist...”我认为Meteor在内部创建每个集合的方法以便控制每个集合,但由于某些原因我需要一次控制多个MongoDB。如何避免这种情况?此外,我意识到我可以像这样直接使用NpmMongo驱动程序,而无需涉及任何NPM包。varMongoCl