-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
observe/observeChanges without initial set of documents #30
Comments
The counts-by-room example skips publishing updates for the initial document set, but it still receives callbacks for all the initial documents; it just skips sending updates. |
Yes, but that takes already a long long time when having large queries.
So for counting that is maybe true. (It is question if you care about that few documents off when you have count in 100000s, though.) But for other uses you might not care about previous state, just changes (so that you do not have to parse the oplog yourself again). BTW, if count is in 100000s, that probably also means that there are many changes to this collection, so sending count updates for each of them is probably not the best. |
Mitar; |
Sadly not. |
(Feel free to upvote this issue.) |
Do you know of any forks/hacks of the Meteor Mongo that we can swap in? |
@mitar crazy that this issue is 4 years old in 5 days... |
PeerDB referencesHere are the current observing use cases causing initialization latency: workaroundHack the collection find to include a query/filter that only matches new/updated documents. |
@raix Yes. I only want/need reactivity part/API of the oplog, not the initial state of the documents. |
Currently observe/observeChanges always go through all documents first, before continuing observing. This is problematic on huge collections. Imagine that you do
.find({}).observe
on a collection with millions of documents. Sometimes you do not need all those documents, you would just want to process changes from that point on.This can be also used to help improving counting performance, that instead of going through all documents initially, one could first to a simple
.count()
and then just keep the count up to date by observing changes and adjusting the count.It would be also useful for PeerDB where we are observing the database for changes for reactive relations between documents.
There were quite some discussion about this in various corners of Meteorlandia but I am not able to find them at the moment. One was about effective counting of documents.
The text was updated successfully, but these errors were encountered: