meteor - What is cursor? -
in discover meteor
,
posts: function() { return posts.find(); }
is used, not this:
posts: function() { return posts.find().fetch(); }
i tried function below, works, , can realtime update.
what cursor exactly? , different of above 2 functions?
the meteor cursor lazy version of array of documents.
it's designed iterate through results of query while not loading each of documents until requested or cursor @ position containing document.
its better think of results of query book. if use .fetch() pages printed though you're not reading them.
the cursor prints pages you're reading them.
additionally cursor has several enhancements regards blaze. content rendered less minute details in document's change able change dom section on own, without recreating entire object. it's easier blaze interact cursor array of javascript objects.
additionally cursor can observed, plain array of javascript object's can't
tldr; cursor array of objects, designed more efficient & more extended features.
Comments
Post a Comment