You can use the Mongo aggregation pipeline to do some powerful reshaping of documents.

It looks like the $redact stage would do what you want - there's a very similar example on the MongoDB site where they want to retrieve specific elements from arrays within documents.


In order to make that process on MongoDB side, you can use skip() and limit() function

const document_by_page = 10;
const page = 1;

db.collection.find().skip(page * document_by_page).limit(document_by_page);

With the new information from your comments, you should use mongo db pipeline to process information on MongoDB side. Take a look at https://docs.mongodb.com/manual/reference/operator/aggregation/filter/#mongodb-expression-exp.-filter.

Have a great day finding your solution