This is follow-up work to related tickets
SERVER-59512 and SERVER-61385. SERVER-59512 introduced DBClientBase::find() as a replacement for DBClientBase::query(). The essential difference between the two is that find() accepts a FindCommandRequest whereas query() accepted something resembling an OP_QUERY, even though the OP_QUERY find format was deprecated in 5.0 and removed in 5.1. SERVER-61385 renamed DBClientBase::query() to DBClientBase::query_DEPRECATED() and migrated almost all callers to DBClientBase::find().
The work for this ticket is to move all lingering remaining callers off DBClientBase::query_DEPRECATED() so that the old API can be deleted from the internal client code. There are three major categories of callers which must be dealt with:
- Callers which run exhaust queries. The new find() API needs to be improved to support exhaust in order to allow these callers to be migrated.
- Callers which rely on the DBClientCursorBatchIterator overload of query_DEPRECATED(). The callers either need to be refactored, or some equivalent of DBClientCursorBatchIterator needs to be introduced to the find() API.
- Callers which still construct an OP_QUERY-style BSON payload, and need it to be parsed to a FindCommandRequest. In particular, this includes the code for dealing with the precondition of an applyOps command, and the call site for the shell in mozjs/mongo.cpp.