UNPKG

seedgoose

Version:

Mongoose data seeding with smart id references tracking.

12 lines (10 loc) 354 B
const map = require('lodash/map'); const times = require('lodash/times'); const flatten = require('lodash/flatten'); const faker = require('faker'); module.exports = flatten(map(["jack", "queen", "kay"], (a) => times(3, (i) => ({ "_id": `${a} post ${i + 1}`, "author": a, "title": faker.random.word(), "content": faker.lorem.paragraphs() }))));