Bring back the 'Show Last Page of Results' button
It would be nice to have the 'Show Last Page of Results' button brought back. Now, to imitate the same functionality, I have to run count(), and set the skip to count() - limit, then run the query again. The new way is very cumbersome.
-
Thomas (3T) commented
We have fixed this in MongoChef 3.4.1 - the button is back :-)
-
Matthew commented
Ah, that makes a lot of sense. I figured that there would have to be a full count() on the collection, and that the "get-last-page" operation would be exactly as you described, but I didn't realize MongoChef was now keep the cursor open. Makes sense why it was removed, but it is very helpful to have if there is another way to implement it. I appreciate your quick response on this.
-
Thomas (3T) commented
First off, please let me apologize for this inconvenience.
Allow me to explain why we removed it:
In previous versions of MongoChef, we actually didn't have proper paging through your result set. In fact, users had to sort of emulate paging by always running a new query with a new skip (and sometimes limit) value. So, effectively, whenever you skipped to the next - or previous - "page", we were running a new query - which for a lot of use cases could be quite slow.
So, with MongoChef 3.4.0 we cleaned this up and now keep the cursor of your query open so that you can very efficiently page forward (we just retrieve the next docs from the cursor) and page backwards (docs are kept in the cache).
Now, MongoDB doesn't have an actual "get-last-page" operation, so what we had to do was run a full count() on your collection - which can result in a very expensive full table scan depending on your query and indices - then subtract the page size to get the skip value that would take you to your last page and then run that actual query. The problem now is that once you have done that, there is no going backwards because MongoDB cursors can only be iterated forward. So, we thought it would be the easiest to do away with the skip-to-last-page button.We have now learnt that many users depended on that button and hold it very dear. I am happy to let you know that we are working on a solution and will be bringing back that button within in the next few days. I'll keep you posted. Once again, I am really sorry for this inconvenience.