Skip to content
This repository has been archived by the owner on Aug 30, 2021. It is now read-only.

how to seed sample data into the mongo db ? #1642

Closed
mrtinkz opened this issue Nov 16, 2016 · 10 comments
Closed

how to seed sample data into the mongo db ? #1642

mrtinkz opened this issue Nov 16, 2016 · 10 comments

Comments

@mrtinkz
Copy link

mrtinkz commented Nov 16, 2016

I tried to seed the sample data but looks like if the below command does anything.

MONGO_SEED=true npm start

'MONGO_SEED' is not recognized as an internal or external command,
operable program or batch file.
@sanathpathiraja
Copy link

In production.js
set
seedDB: {
seed: process.env.MONGO_SEED === 'true',

then
MONGO_SEED=true npm start:prod

if got problem
use npm install gulp-sass --save-dev

@mrtinkz
Copy link
Author

mrtinkz commented Nov 17, 2016

It's already configured that way, so should it work ?

seedDB: {
    seed: process.env.MONGO_SEED === 'true',
    options: {
      logResults: process.env.MONGO_SEED_LOG_RESULTS !== 'false',
      seedUser: {
        username: process.env.MONGO_SEED_USER_USERNAME || 'seeduser',
        provider: 'local',
        email: process.env.MONGO_SEED_USER_EMAIL || '[email protected]',
        firstName: 'User',
        lastName: 'Local',
        displayName: 'User Local',
        roles: ['user']
      },
      seedAdmin: {
        username: process.env.MONGO_SEED_ADMIN_USERNAME || 'seedadmin',
        provider: 'local',
        email: process.env.MONGO_SEED_ADMIN_EMAIL || '[email protected]',
        firstName: 'Admin',
        lastName: 'Local',
        displayName: 'Admin Local',
        roles: ['user', 'admin']
      }
    }
  }

@mrtinkz
Copy link
Author

mrtinkz commented Nov 17, 2016

Also, how does the gulp-sass relate to mongo seed ?

@sanathpathiraja
Copy link

What is the you got error.
if you run MONGO_SEED=true npm start:prod
follow the [https://github.com/meanjs/mean/blob/master/README.md#running-with-user-seed]

@mrtinkz
Copy link
Author

mrtinkz commented Nov 17, 2016

I am running it in a command prompt and i get the below error.

'MONGO_SEED' is not recognized as an internal or external command,
operable program or batch file.

@sanathpathiraja
Copy link

sanathpathiraja commented Nov 17, 2016

check mongodb is running and you are cd your project folder.
try to,
clone master repo.
and run it.

@mrtinkz
Copy link
Author

mrtinkz commented Nov 17, 2016

So it doesn't work on the code generated by yo generator ? It should all be same correct ? how would it be any difference ?

@sanathpathiraja
Copy link

sanathpathiraja commented Nov 17, 2016

I use it cloning master repo.
it's work for me.

@hyperreality
Copy link
Contributor

Probably a problem with environment variables in windows

@mrtinkz
Copy link
Author

mrtinkz commented Nov 17, 2016

Thanks, I figured it was a problem with the command prompt I am using, tried the same in cygwin and it worked.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants