Uploaded image for project: 'Documentation'
  1. Documentation
  2. DOCS-11663

There is no explanation of how queries against views are implemented

    XMLWordPrintable

Details

    • 3
    • ServerDocs2021: Oct26 - Nov2, ServerDocs2021: Nov2 - Nov9
    • true

    Description

      Our documentation for views says only

      Views are computed on demand during read operations, and MongoDB executes read operations on views as part of the underlying aggregation pipeline.

      (in a section titled View Creation).

      While that is all correct, more detail is needed. I suggest something like:

      What happens when you run a query against a view is:

      • the query filter, projection, sort, skip, limit etc parts of the find command are converted to their equivalent aggregation stages.
      • those stages are added to the end of the aggregation pipeline in the view definition.
      • Aggregation Pipeline Optimization then reorders and/or coalesces stages where doing so will give a performance benefit while not changing the results.

      (and it would probably be appropriate under the heading for Behaviour on the same page.

      Attachments

        Activity

          People

            jason.price@mongodb.com Jason Price
            william.byrne@mongodb.com William Byrne III
            Jason Price Jason Price
            William Byrne III
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              39 weeks, 1 day ago