DEV Community

Cover image for 🚀 API Maker - Update by id & Replace by id API [Put operation]
API Maker®
API Maker®

Posted on

🚀 API Maker - Update by id & Replace by id API [Put operation]

Update By id

▸ Update the object's properties that match the payload and
👉 leave the others unchanged.

Replace By id [Mongo specific API]

▸ Update the object's properties that match the payload and
👉 remove the rest of properties.


✅ List of Feature
⚡️ Primary key override
⚡️ Modify response using Query Params
⚡️ Nested level update
⚡️ Upsert support
⚡️ Retrive response prior to update or after the update


⭐ Params ⭐

👉 id ▸ User can update single record by id
👉 primaryKey ▸ Based on primary key field, user can update data.


⭐ Query Params ⭐

👉 select ▸ Retrieve the fields based on the user's needs.
👉 deep ▸ Obtain more precise / details data in a certain field.
👉 upsert
▸ true :- If record is not present then perform insert operation
▸ false :- If record is present then perform update operation
👉 returnDocument
▸ before :- Retrieve the response prior to updating it.
▸ after :- Retrieve the response after the update.


Youtube video link

https://youtu.be/PhtWr4kVkMQ

Websites

https://apimaker.dev

API Docs link

Generated-APIs

https://docs.apimaker.dev/v1/docs/apis-all/generated-apis/auto-generated-update-by-id-api.html
https://docs.apimaker.dev/v1/docs/apis-all/generated-apis/auto-generated-replace-by-id-api.html

Schema-APIs

https://docs.apimaker.dev/v1/docs/apis-all/schema-apis/auto-generated-schema-based-update-by-id-api.html
https://docs.apimaker.dev/v1/docs/apis-all/schema-apis/auto-generated-schema-based-replace-by-id-api.html

More Examples

Generated-APIs

https://docs.apimaker.dev/v1/examples/sys/db/updateById.html
https://docs.apimaker.dev/v1/examples/sys/db/replaceById.html

Schema-APIs

https://docs.apimaker.dev/v1/examples/sys/db/gen/updateByIdGen.html
https://docs.apimaker.dev/v1/examples/sys/db/gen/replaceByIdGen.html

Follow on twitter

https://twitter.com/api_maker

Linked In

https://www.linkedin.com/company/api-maker

More YouTube Videos

https://www.youtube.com/@api_maker/playlists

Top comments (0)