I’d like to find and delete many records. In the console, I’d do this with db.collection.findAndModify, but for some reason the go driver has this method as private. The FindOneAndModify, FindOneAndDelete, and FindOneAndReplace methods all internally call the private findAndModify method … but they all limit things to a single result.
What is the proper way to atomically find and delete many records using the go driver? A session seems like the right direction, but reading the causal consistency guarantees, but even in the write follows reads model, isolation is not guaranteed (that is, another session can interleave between my read and delete).