We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent e48771c commit f4f71c6Copy full SHA for f4f71c6
mongoapp.js
@@ -1,12 +1,11 @@
1
var MongoClient = require('mongodb').MongoClient
2
3
// Open the connection to the server
4
-MongoClient.connect('mongodb://localhost:27017/test', function (err, db) {
+MongoClient.connect('mongodb://127.0.0.1:27017/test', function (err, db) {
5
if (err) throw err
6
7
// Find one document in our collection
8
- db.collection.findOne({}, function (err, doc) {
9
- if (err) throw err
+ db.collection('users').findOne({}, function (err, doc) {
10
// Print the result
11
console.dir(doc)
12
0 commit comments