Closed isaklafleur closed 6 years ago
got the same error, ended up using fakerjs directly:
var MongoClient = require('mongodb').MongoClient
var test = require('assert')
var ObjectId = require('mongodb').ObjectID
var faker = require('faker')
MongoClient.connect('mongodb://localhost:27017/yourdatabase', function(err, db) {
test.equal(err, null)
let collection = db.collection('Employees')
let documents = []
for ( i=0; i < 100; i++ ) {
docsuments[i] = {
name: faker.name.findName(),
email: faker.internet.email(),
core: faker.company.bsBuzz(),
url: faker.fake("www.{{internet.domainSuffix}}.{{name.suffix}}"),
phone: faker.phone.phoneNumber(),
id: faker.random.uuid(),
position: faker.name.jobType()
}
}
collection.insertMany(documents, function(err, response) {
test.equal(err, null)
console.log(response.insertedCount)
db.close()
})
})
Then simply save this as a JS file and run it with;
node yourfile.js
Hi!
I'm trying to run the command from the folder where fakegoose-celebrity.js is located:
fakegoose fakegoose-celebrity.js --count 10 --seed mongodb://localhost:27017/mongoose-movies
I have installed fakegoose locally and globally..
Here is the fakegoose-celebrity.js file
I get this error message: