You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Loading fixtures from - mongoose-fixture-config.js
Established Connection MongoD (localhost:27017)
Mongoose-Fixture init schemas/models into conn
/usr/local/lib/node_modules/mongoose-fixture/node_modules/mongoose/node_modules/mongodb/lib/mongodb/db.js:286
throw err;
^
TypeError: Cannot call method 'create' of undefined
at async.forEach.msg (/usr/local/lib/node_modules/mongoose-fixture/lib/BaseFixtureLoader.js:90:34)
at /usr/local/lib/node_modules/mongoose-fixture/node_modules/async/lib/async.js:99:13
at Array.forEach (native)
at _each (/usr/local/lib/node_modules/mongoose-fixture/node_modules/async/lib/async.js:32:24)
at Object.async.each (/usr/local/lib/node_modules/mongoose-fixture/node_modules/async/lib/async.js:98:9)
at /usr/local/lib/node_modules/mongoose-fixture/lib/BaseFixtureLoader.js:86:19
at module.exports (/var/www/dev/mysite/fixtures/Users.js:26:12)
at module.exports (/usr/local/lib/node_modules/mongoose-fixture/lib/BaseFixtureLoader.js:36:76)
at async.eachSeries.conn.close.disconnectMessage (/usr/local/lib/node_modules/mongoose-fixture/lib/MongooseFixture.js:67:17)
at iterate (/usr/local/lib/node_modules/mongoose-fixture/node_modules/async/lib/async.js:123:13)
cat fixtures/Users.js
var sha1 = require('sha1');
module.exports = function(mongoose, conn, callback){
// standard callback error
var error = null;
// create your data documents using object-literals
var fixture = [];
/*
* Example of adding a data document/fixture item
*/
fixture.push({
// by not defining an _id mongoose-fixture
// will by default set a mongo ObjectID
// defining one manually will override mongoDB
username: 'admin',
password: sha1('admin'),
email: 'dev@clintagency.com',
role: 'admin'
});
// mongoose-fixture expects implementor to return
// the callback passed in context
return callback(error, fixture);
};
mongoose-fixture --fixture='all' --add
cat fixtures/Users.js
cat schemas/UserSchema.js
cat mongoose-fixture-config.js
The text was updated successfully, but these errors were encountered: