Without sync priority or performance requirements on the task, I need to check all documents once per day and removing some of them.
The find filter is not static but can be defined within a db engine script function like function check_doc(){ }
.
With .find() - no filter/condition in brackets - the function will check some non-indexed fields and decides whether the document must be removed or not.
.find().check_doc()/forEach
the most effient way for iteratively checking each document, one by one, and remove justOne from there?
Furthermore, is there a variable available for checking the mongodb status, whether it is locked or sync delay (because of other queries and tasks on the DB)? If so, I'd prefer to delay the check_doc which has lowest priority. However, so far I could not find a way to decrease priority or a flag to check the status/delay.