Skip to content

Upgrade to 3.x Mongo driver #76

@ericyhwang

Description

@ericyhwang

sharedb-mongo is currently using the 2.x Mongo driver out of the box.

The Mongo driver has been on 3.x for a while now, but from the 3.x release notes, it does introduce some breaking changes that would impact sharedb-mongo.

That includes:

  • MongoClient.connect(connectionString, callback) results in a mongodb.Db instance in 2.x, and it results in a mongodb.MongoClient instance in 3.x.
  • mongodb.Collection#aggregate results in a result array in 2.x, and it results in a mongodb.AggregationCursor in 3.x.
  • The results of mongodb.Collection#mapReduce may have changed in an incompatible way.

To be safe, sharedb-mongo should major version when officially upgrading to mongodb@3.x.

It is possible today to pass a mongodb.Db provider function when constructing a ShareDBMongo, which could allow you to use a 3.x Mongo driver since you skip sharedb-mongo creating its own connection. I think everything would work except aggregations.

It might be possible to make forward-compatible changes to support 3.x drivers, prior to major-versioning sharedb-mongo to officially switch to 3.x.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions