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

Comment on: "manual/tutorial/project-fields-from-query-results.txt"

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major - P3 Major - P3
    • None
    • None
    • None

    Description

      This document fails to describe how to limit fields to those nested in objects.

      e.g.

      {
      _id: 0,
      session: 5
      data:

      { x: 0, y: 0 }

      }

      db.stats.find(

      {session: 5}

      , {fields:

      { "data.x": 1, "data.y": 1 }

      );

      Is it even possible to flatten the fields so my results are

      {x, y}

      instead of {data: {x,y}}?

      Reporter: concerned citizen

      Attachments

        Activity

          People

            kay.kim@mongodb.com Kay Kim (Inactive)
            xgen-internal-docs Docs Collector User (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              8 years, 35 weeks, 2 days ago