Generalizes query_mongo_index and query_mongo_pages into one function, query_mongo.
Updates doc string for database function query_mongo.