Closed abecks closed 8 years ago
Same for me, any solution?
@abecks.
I assume your Meteor.publish
callback takes a query
argument unlike the given example from the docs. If so, then you might be running into multiple Counts.publish
conflicting because they all have the same name, 'CompanyInfiniteCount'
.
I don't recall if Meteor automatically stops an existing subscription if you subscribe again with different arguments. If not, then save the handle returned by Meteor.subscribe
and call handle.stop()
before running Meteor.subscribe
with the new query/selector.
There may be some overlap with an issue described in #66 in this comment.
If you can generate a very basic Meteor app that demonstrates this problem and upload it to github with a link in a comment here, I'll fidget with it and come up with some better advice.
@boxofrox you are 100% correct. I actually ended up abandoning Counts and I'm now periodically polling a server method for the count as needed. Still a great package!
@abecks glad you found a solution.
@DominikGuzei if you're still seeking a solution for this issue, let's begin in a new issue.
Haha, found the same "solution" as @abecks – polling methods, since that's the only performant way to count large collections. The realtime aspect is much less important for us :wink:
But btw. my solution to the problem discussed here was to separate the counter publication from another one. So the problem seemed to be related with using Counts.publish
and then returning another record set like Meteor.users.find(…)
in the publication
I have a publication that looks like this:
Designed to give me the total count of company records, and then returning a limited cursor for pagination.
When
query
changes (to filter the list), the result ofCounts.get('CompanyInfiniteCount')
is not changing from it's initial value.I am trying to achieve the same thing as this example in the docs:
But with a changing document selector. Am I using Counts wrong?