Skip to content

Latest commit

 

History

History
31 lines (21 loc) · 928 Bytes

README.md

File metadata and controls

31 lines (21 loc) · 928 Bytes

meteor-remote-collection

Use additional MongoDB databases in your Meteor app.

Installation

$ meteor add maxfi:remote-collection

Usage

On client or server:

// using a MongoDB URI
MyCollection = new RemoteCollection('mongodb://username:password@localhost:27017/database');

// or using an environment variable
MyCollection = new RemoteCollection('SOME_ENV_VAR'); // Where `process.env.SOME_ENV_VAR`

// optionally pass in connection options
var connectionOptions = {oplogUrl: 'mongodb://username:password@localhost:27017/local?authSource=admin'};
MyCollection = new RemoteCollection('SOME_ENV_VAR', connectionOptions);

// or optionally pass in OPLOG URI
MyCollection = new RemoteCollection('SOME_ENV_VAR', 'SOME_OTHER_ENV_VAR'); // Where `process.env.SOME_OTHER_ENV_VAR`

To Do

  • Potentially reuse MongoInternals.RemoteCollectionDriver across multiple RemoteCollection instances.