def _find_single_id(self, doc_id): """Find a document by its id. Takes a hexadecimal document id string and returns the corresponding document. """ id_filter = mongodb_queries.id_query(doc_id) doc = self._collection.find_one(id_filter) return mongodb_results.get_results(doc)
def _find_multiple_ids(self, doc_ids): """Find documents by their ids. Takes a list of hexadecimal document id strings and returns the corresponding documents. """ id_filter = mongodb_queries.ids_filter(doc_ids) docs = self._get_search_results(id_filter) return mongodb_results.get_results(docs)