claims there is no oplog support for geospatial queries.
that was as of ~ Meteor .7
Is this still true? For queries using $near or $geoWithin on the server?
When will support for $skip happen? Currently I am relying on a simple hack: when request next page in a pagination scheme, change the query to only allow results $gt/$lt (depending on sort order) the previous page’s LAST item.
I worked on Oplog tailing for $limit and as far as I remember, I couldn’t come up with any efficient way to implement $skip w/o storing half of the data set in memory. (which is obviously not something you would like to do, ever)
It is important to note that operations like $skip is actually very inefficient in the MongoDB itself (regular queries), so using it in any queries is not advised (static, or live queries).
Also, in RethinkDB, the change-feeds feature also prohibits the use of skip as it is super inefficient in all cases mentioned above.
Right, but the small problem with the so-called ranged query implementation is the case where the sort field contains duplicated elements. In the case of real numbers, highly unlikely. But unless one could guarantee uniqueness, then something like $lte/$gte would have to be used and the user would be forced to see the last element of page N-1 as the first element of page N.
Not a huge deal, but still a small caveat. Any updates you can give us for $geoQueries? The comments in the snippets above are a tad confusing - what are the main problems with $geoWithin and $near?
I think even if you have duplicate values, you can uniquely order elements by a compound comparator such as “compare by date, then if equal, compare by _id”? As far as I understand MongoDB supports compound indexes too.
For geospatial queries, it is just difficult to implement the exact logic of geospatial selectors in Minimongo, that is used in oplog tailing to incrementally recompute the query. Since there is work with floating point numbers involved, it is harder to replicate the behavior of MongoDB’s C++ code in JS. Also, the code comments explain some weird behavior of $near.
Well I wasnt able to get geowithin to sort and limit. I was having all kinds of issues honestly. I havent checked the performance much yet – thats definitely something I need to do. I have created any indexes either…
Cant sort by distance. Thats correct. Luckily I didnt need to though…