Add count to the data browser

XMLWordPrintableJSON

    • Type: Task
    • Resolution: Unresolved
    • Priority: Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • None
    • Developer Tools

      Showing the document count requires an additional run of count, outside of the find we run for documents. Let's run it in parallel and show it in the UI when it returns. Let's cap the request at 5000ms. Here's where we do the count in Compass's Documents tab: https://github.com/mongodb-js/compass/blob/0441b94add3bb7ff80d71625767915ea140bbdcf/packages/compass-crud/src/utils/cancellable-queries.ts#L6 

      When the count request errors or times out (with the 5000 ms maxTimeMS), let's show a `?` for the count with a tooltip on it that's the similar to the one shown in Compass: https://github.com/mongodb-js/compass/blob/0441b94add3bb7ff80d71625767915ea140bbdcf/packages/compass-crud/src/components/crud-toolbar.tsx#L129 

      Some more context, in a later milestone we'll use this same logic for when we're showing aggregation results (although then the count will require a click to run, like in Compass' aggregations tab).

            Assignee:
            Unassigned
            Reporter:
            Rhys Howell
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: