E
E
EchoStan2018-12-10 17:16:06
MongoDB
EchoStan, 2018-12-10 17:16:06

Give part of mongodb collection?

at the front, you need to display a long collection (up to 1M documents), breaking it into parts of 100 documents - otherwise it will not fit in the memory of the server / browser / mongo itself etc.
Order - by the time the document was created.
At the moment, there is no field in the document that could be used to generate chunks. I don't want to add it. I don’t want to pull out the entire collection and manipulate it in the server’s memory either, all the more it can’t fit.
ODM - mongoose, latest versions.
Is there some kind of nativshchina that I missed?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
E
EchoStan, 2018-12-10
@EchoStan

nativshchina googled, solved through
1) .countDocuments( ) - building a "map" of chunks
2) .skip(chunk number * chunk size).limit(chunk size)
mb useful to someone :)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question