#4347·loopback

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

Author: natuan62Created Mar 14, 2021Updated Jul 21, 2021
Labelsstalequestion

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