Skip to content

Put replace

PUT REPLACE API only for MongoDB.
This API will replace whole object.
Send all required key-value pairs which you want to update in request body. Request url contains 'ID' of the data object.

Replace with custom primaryKey

Update single key in single object.
Request body contains object of key-value pair.

Request body

{
    "category_id": 73459,
    "created_at": "2021-02-03T21:07:00.000Z",
    "description": "Dynamic",
    "id": 1,
    "image_url": "http://placeimg.com/640/480/abstract",
    "name": "Noemy",
    "owner_id": 1,
    "price": 26462,
    "status": 1
}

Generated url:

/replace-by-id/1/owner_id
Here we have to pass primary key number (mostly its 'id') of the object in the request url. put-replace-custom-primaryKey put-replace

Replace with select

Replace API response we can get selected data using 'select' param.

Generated url:

/replace-by-id/1/owner_id?select=owner_id,category_id
put-replace-select

Replace with deep

In Replace API response we get inherit data using 'deep' param.

Generated url:

/replace-by-id/1/owner_id?deep=[{"s_key":"owner_id","t_col":"customers","t_key":"customer_id"}]
put-replace-deep