loopback icon indicating copy to clipboard operation
loopback copied to clipboard

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

Open natuan62 opened this issue 4 years ago • 1 comments

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

natuan62 avatar Mar 14 '21 06:03 natuan62

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Jul 21 '21 05:07 stale[bot]