How to query in batches by MongoDB

demand:

when querying the list of articles, the management interface also displays the total number of articles that meet the query criteria. For example, the search article content on the page contains the list of articles with artificial intelligence and displays the query statements corresponding to the total number of articles

.
db.posts.find({text://})
db.posts.count({text://})

but how to batch query? Similar to bulkWrite batch update insert

db.posts.bulkQuery([
{findMany:{text://}},
{count:{text://}}
])

and preferably within MongoDB is also a concurrent query

Mar.06,2021

what about asynchronous programming?

Menu