Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-31576

Allow users to easily query for the list of Views in their database

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Works as Designed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Storage
    • Labels:
    • Backwards Compatibility:
      Fully Compatible

      Description

      Currently, it is a little bit tricky to determine the list of views in a database. There are two options:

      1. Specifically grant access to the find action on the system.views collection.
      2. Call listCollections and filter for all entries returned that do not have an options.storageEngine field.

      The first option is both tedious (grant needs to be performed for the system.views collection on every database) and also probably not something we really want users to rely on. (See SERVER-27554).

      The second is a little obscure. It does not seem reasonable to assume that an external user can piece together that a view is a collection without a storageEngine.

      Suggestion: add a new field to each entry in the output of listCollections that indicates whether or not the entry represents a collection or a view, and add a new option for the supported filters on the listCollections command so that a list of only-views can be returned.

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                8 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: