Skip to content
This repository was archived by the owner on Jul 12, 2020. It is now read-only.
This repository was archived by the owner on Jul 12, 2020. It is now read-only.

addUser -force yield mongo error #21

@tkhduracell

Description

@tkhduracell

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions