Skip to content

Commit ae495cf

Browse files
committed
Seeding Fix due to changes on new mongo-seeding package
1 parent 3321428 commit ae495cf

File tree

3 files changed

+11
-6
lines changed

3 files changed

+11
-6
lines changed

CHANGELOG.md

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
## v.1.1.3 (Oct 24, 2018)
2+
* Seeding Fix due to changes on new mongo-seeding package
3+
14
## v.1.1.2 (Oct 23, 2018)
25
* NPM updated
36

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "node-express-mongodb-jwt-rest-api-skeleton",
3-
"version": "1.1.2",
3+
"version": "1.1.3",
44
"description": "Node.js express.js MongoDB JWT REST API - Basic Project Skeleton. Great for building an MVP for your front-end app (Vue, react, angular, or anything that can consume an API)",
55
"license": "MIT",
66
"repository": {

seed.js

+7-5
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,17 @@
11
require('dotenv-safe').config()
2-
const { seedDatabase } = require('mongo-seeding')
2+
const { Seeder } = require('mongo-seeding')
33
const path = require('path')
44
const config = {
5-
databaseConnectionUri: process.env.MONGO_URI,
5+
database: process.env.MONGO_URI,
66
inputPath: path.resolve(__dirname, './data'),
77
dropDatabase: false
88
}
9+
const seeder = new Seeder(config)
10+
const collections = seeder.readCollectionsFromPath(path.resolve('./data'))
911

10-
const seed = async () => {
12+
const main = async () => {
1113
try {
12-
await seedDatabase(config)
14+
await seeder.import(collections)
1315
console.log('Seed complete!')
1416
process.exit(0)
1517
} catch (err) {
@@ -18,4 +20,4 @@ const seed = async () => {
1820
}
1921
}
2022

21-
seed()
23+
main()

0 commit comments

Comments
 (0)