Given a List of mongo document UUIDs, I would like to validate if these IDs have corresponding documents in the DB. What is the efficient way to perform bulk validation?
Lets say my program has 100 id strings and would like to validate all these IDs in one DB call. Is it feasible?
I could do it sequentially (i.e using exists(T id) methods in spring data repository) but I would rather want to do in one call.
My program uses spring data for mongodb. But I am open to any native mongo command. I can code the Query in spring data for it. Also, If any of the ID in the list does not have a document in DB, I want to get such ID in response.