Closed zirho closed 8 years ago
$node ./node_modules/mongodb-migrate -runmm Connected correctly to server up : migrations/0005-add-posts.js Error inside migration: migrations/0005-add-posts.js Error: [Error: collection name must be a String]
var mongodb = require('mongodb'); exports.up = function(db, next){ var posts = mongodb.Collection(db, 'posts'); posts.insert({title: 'post awef'}); next(); }; exports.down = function(db, next){ next(); };
Hi, I can't figure out what's wrong with my code
thanks.
Oh this is because I was using mongo <= 2.x I think I should require mongo 3.x manually to use above 3.0
Hi, I can't figure out what's wrong with my code
thanks.