microbiomedata / nmdc-runtime

Runtime system for NMDC data management and orchestration
https://microbiomedata.github.io/nmdc-runtime/
Other
7 stars 3 forks source link

Add endpoint that accepts list of biosample ids and updates #119

Open sujaypatil96 opened 2 years ago

sujaypatil96 commented 2 years ago

I believe there isn't an endpoint at https://api.dev.microbiomedata.org/docs#/ that accepts a list of NMDC biosample Ids, and updates each of those ids with data from a new JSON file, with possibly new fields.

Like say, we want to update gold:Gb0315661 in the Mongo database. We should be able to provide a JSON, which may or may not have new fields for the gold:Gb0315661 record to that endpoint, and the method running behind the endpoint should loop through all the unique records from the JSON file, drop whatever existing document there is, and replace is it with data from the new JSON.

CC: @cmungall @dwinston

aclum commented 1 month ago

@sujaypatil96 you should be able to use json:submit to do this. please test on dev and see if it meets your needs.