How do I know which version of Mongodb Driver my Project is using?


#1

Hi!

I’m getting an error message on the server side

Exception in setInterval callback: MongoError: driver is incompatible with this server version

so the first thing that came to my mind in order to start debugging this problem was to ask this question

How do I know which version of Mongodb Driver my Project is using?

thanks! :slight_smile:


#2

It’s easy to check:

$ meteor mongo
MongoDB shell version 2.6.7

#3

@ffxsam thanks for your response! is this still true if I’m connecting to an external mongodb instance???

MONGO_URL=‘mongodb://localhost:27017/webui’ meteor


#4

Nope, to check an external MongoDB, connect to it via your mongo client, then type db.version() and it’ll print out the server version.


#5

Sorry to revive this old thread, but when you ask in the mongo console, isn’t it going to give you the database version, and not the driver version? For the driver version, I think you’ll want to look in the npm-mongo package used by meteor. So for example for meteor 1.5.1, you could look here:

https://github.com/meteor/meteor/blob/release-1.5.1/packages/npm-mongo/package.js#L11


#6

None of this packages exist in my project, so I’m bumping this question.

I looked throught the release notes and only found this reference:

v1.4.1.1, 2016-08-24
Update the version of our Node MongoDB driver to 2.2.8 to fix a bug in reconnection logic, leading to some update and remove commands being treated as inserts. #7594

Can I assume there was no update to the drivers since this date?
Shouldn’t this be easy to check directly on my machine?

Thanks!

EDIT: By the way, my real issue is knowing which MongoDB versions are supported by my current project (running Meteor 1.6.0.1).

https://docs.mongodb.com/ecosystem/drivers/driver-compatibility-reference/#reference-compatibility-language-node


#7

On the server you can get the driver version with

MongoInternals.NpmModules.mongodb.version

#8

meteor:PRIMARY> MongoInternals.NpmModules.mongodb.version
2018-02-21T11:36:23.955+0000 E QUERY [thread1] ReferenceError: MongoInternals is not defined :

Don’t get me wrong, this would be a fast fix, but there should be a simple way to check which driver I have (and probably there is, but I just can’t find the mongo package).


#9

Not in the mongo shell. In Meteor server code.


#10

That worked, thanks!

This is the release note:

v1.4.3.2, 2017-03-14

The mongodb npm package used by the npm-mongo Meteor package has been updated to version 2.2.24. PR #8453 Issue #8449