mongoosejs/mquery

Different mongo driver versions in mquery vs mongoose

Closed this issue · 3 comments

As of now, we have the following versions:

mongoose@3.8.4 node_modules/mongoose
...
├── mongodb@1.3.23 (kerberos@0.0.3, bson@0.2.5)
└── mquery@0.4.1 (debug@0.7.0, mongodb@1.3.19)

As you can see, mongoose@3.8.4 requires mongodb@1.3.23, and mquery@0.4.1 which itself requires mongodb@1.3.19. Two versions of mongodb driver are loaded, which is +150ms to startup time and a source of magic incompatibility errors.

Keeping versions in sync would help, but is prone to forgetting, etc. Maybe it's better to provide external mongodb driver reference to the mquery before use, i.e.:

mongodb = require('mongodb')
mquery = require('mquery')(mongodb);

yeah I think there's another issue open related to this. might be nice to support passing in an ObjectId constructor and optionally a ReadPref constructor. then we don't have any direct dependency

pull request?

Fixed in #26. Closing.