Advertisement
Guest User

Untitled

a guest
Sep 17th, 2019
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. // before
  2. MongoClient.connect(/* 省略 */, function (err, db) {
  3. if (err) { return console.dir(err); }
  4. db.collection("users", function (err, connection) {
  5. /* 省略 */
  6. });
  7. /* 省略 */
  8. });
  9.  
  10. // after
  11. MongoClient.connect(/* 省略 */, function (err, client) { // 1. dbからclientへ変更して下さい。
  12. var db = client.db('test'); // 2. この行を追加して下さい。
  13. db.collection("users", function (err, connection) {
  14. /* 省略 */
  15. });
  16. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement