Queries with limit but no sort aren’t oplog tailable. Also, I took another look at the oplog docs and it appears that any queries using skip aren’t oplog tailable.
Here is a link to the (rather difficult to find) documentation on oplog tailing in Meteor: https://github.com/meteor/docs/blob/version-NEXT/long-form/oplog-observe-driver.md. I also wrote this package to help figure out which publications aren’t oplog tailable.
The reason why queries with a limit must always have a sort is a bit difficult to explain.
The oplog is a stream of individual document updates. If a single operation modifies 100 documents in the database, this will create 100 entries in the oplog. For a query to be oplog tailable, it must be possible to efficiently tell whether or not the result set of a query has changed by looking only at these individual updates, one by one.
Suppose a query has a limit of 10 and no specified sort. The query will return the first 10 matching documents sorted by the natural ordering. The natural ordering is an implementation detail of Mongo, and completely opaque to Meteor. So from Meteor’s perspective the query will just return 10 random documents.
Now suppose we insert a new document matching the query. When Meteor sees this update it has no way of knowing whether or not Mongo would consider this document to be in the first 10 documents according to the natural ordering. So it has to re-poll the whole query.
If the query does have a sort then Meteor can be much smarter. It can look at the individual update coming through the oplog and see if the corresponding document belongs in the first 10 documents. If it doesn’t, then no need to re-poll.
However, I think that Meteor should still do oplog tailing even when there is a limit without a sort. When there is a limit, having a sort is definitely more efficient than not having a sort, but oplog tailing would still be better than polling even when there is no sort.
The only reason I can think of why Meteor may require the sort in the presence of a limit is if the natural ordering isn’t assumed to be stable. If it could change at any time I can see why polling would be necessary (since the result set could change at any time).
Anyway, if you have a limit and don’t care about the sort order then just sort by _id. The _id field has a built-in index so it’s free.