db.collection is not a function when using MongoClient v3.0

I encountered the same thing. In package.json, change mongodb line to “mongodb”: “^2.2.33”. You will need to uninstall mongodb npm by removing MongoDB Driver/ node_modules or etc , then install npm to install this version. This resolved the issue for me. Seems to be a bug or docs need to be updated.

mongoDB, connection refused

By default MongoDB only binds to the loopback interface which makes it only accessible from localhost. To change that you need to edit this line in mongod.conf file; you can change it to bind_ip = 127.0.0.1,192.168.1.102 to allow LAN and local connections or you can remove or comment out that line to allow all connections. For more info : MongoDB … Read more

MongoError: failed to connect to server [localhost:27017] on first connect

Update 2020 Feb 24: It would be wise to stay tuned with it. Here is the link for latest library instruction: https://docs.mongodb.com/manual/administration/install-community/ You haven’t started your monogo database. first install mongo install mongo as per your OS https://docs.mongodb.com/v3.0/tutorial/ then follow instructions mentioned on this site: https://docs.mongodb.com/v3.0/tutorial/getting-started-with-the-mongo-shell/ cd . mongod –dbpath “any directory path to start your database … Read more

Uninstall MongoDB on Mac OS X

When I try to run mongod from the terminal, I get the following error: 2014-07-02T23:56:24.797-0700 [initandlisten] ERROR: listen(): bind() failed errno:48 Address already in use for socket: 0.0.0.0:27017 2014-07-02T23:56:24.797-0700 [initandlisten] ERROR: addr already in use I recently realize that I have two versions of MongoDB on my Mac, and think this may be the source … Read more