Search code examples
node.jsmongodbraspberry-piraspbian

Use mongodb node.js package with mongodb version 2.4


I'm running a website through node.js on my raspberry pi and want to connect it to a mongodb database. Unfortunately the through the repositories provided mongodb server is only of version 2.4 due to the 32 bit system.

I tried to compile a higher version of mongodb without success. Trying to connect to the database through my node.js application gives me this error:

MongoError: Server at localhost:27017 reports wire version 0, but this version of Node.js Driver requires at least 2 (MongoDB2.6).

Is there any way to tell the mongodb node.js package to use the lower version of Mongodb?


Solution

  • Ok, so I solved it quite easily. You can set the version of mongodb in the package.json file to a lower one. The 2.X versions apparently use mongodb version 2.4 or less!