I'm working on a project within my company and noticed that some people on different stackoverflow answers did recommend the usage of query cursors.Is this:let items = items.find().cursor(); let item = await items.next(); while (item) { // .... item = await items.next(); }a more recommended way for large data rather than doing this?:let items = await items.find();If so, what are the reasons? I've read it could save memory load, where as example 1 would load only a single item into memory where as example 2 would load everything into memory at once.I'd like to hear some pro's and con's about this, as well as when to which one.If you have personal issues with example 1 or 2 then feel free to share them. Would love to know it.
Submitted May 20, 2020 at 05:51AM by koomenk
No comments:
Post a Comment