mia-platform / crud-service

A lightweight application to expose restful CRUD API over HTTP interface
https://docs.mia-platform.eu/docs/how_to/crud_service/crud_oss_usage
Apache License 2.0
43 stars 4 forks source link

Dry Run Insertion #327

Open GioAc96 opened 3 months ago

GioAc96 commented 3 months ago

Feature Description

Good afternoon. We need to implement an application that deletes all documents on a CRUD collection and replaces them with data imported from another source. However, we would like to validate the data provided by the third-party source before deleting all documents in our CRUD collection. It would be very helpful for this task if the CRUD service offered a "dry-run" option that can be specified as a request parameter on the POST endpoints (namely the POST / and POST /bulk endpoints). With this option enabled, the CRUD service would do everything it normally does, including the validation of the uploaded documents, but it would not perform the actual insertion on MongoDB.

Possible alternatives

A possible alternative would be to implement POST /validate and POST /validate/bulk endpoints which perform only the validation of the uploaded documents