Strider-CD / strider-cli

CLI for Strider
15 stars 9 forks source link

addUser -force yield mongo error #21

Open tkhduracell opened 7 years ago

tkhduracell commented 7 years ago

Running this multipel time fails...

Command

DB_URI=mongodb://strider:pass@ds000000.mlab.com:55747/strider-db 
/usr/bin/strider addUser -l test@gmail.com -p testtest -a -f

Gives error

Connecting to MongoDB URL: mongodb://strider:pass@ds000000.mlab.com:55747/strider-db

Mongoose: mpromise (mongoose's default promise library) is deprecated, plug in your own promise library instead: http://mongoosejs.com/docs/promises.html
Error adding user: { [MongoError: E11000 duplicate key error index: strider-db.users.$email_1 dup key: { : "test@gmail.com" }]
  name: 'MongoError',
  message: 'E11000 duplicate key error index: strider-db.users.$email_1 dup key: { : "test@gmail.com" }',
  driver: true,
  code: 11000,
  index: 0,
  errmsg: 'E11000 duplicate key error index: strider-db.users.$email_1 dup key: { : "test@gmail.com" }',
  getOperation: [Function],
  toJSON: [Function],
  toString: [Function] }

Doc for -force flag

-f Force create user, existing users with the same email address get updated (flag) (default: false)

tkhduracell commented 7 years ago

@kfatehi @knownasilya