Skip to content

MongoDb connector : Error "E11000 duplicate key error index: _id: {_id} when use PATCH api #4347

Description

@natuan62

I research some solutions like

loopback MongoError: E11000 duplicate key error collection: my-db.News index: _id_ dup key

// set /models/ .json like

// or 
"idInjection": false,
"forceId": false

// or set
 "properties" : {
  "id": {
     "type": "string",
     "mongodb": {dataType: 'ObjectId'}
  }
}

// or set in model-config.json
  "options": {
      "strictObjectIDCoercion": true
    }

but still not working

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions