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

Query for field names in a collection

    XMLWordPrintableJSON

Details

    • Icon: New Feature New Feature
    • Resolution: Done
    • Icon: Minor - P4 Minor - P4
    • None
    • None
    • Admin
    • None
    • Query
    • Fully Compatible

    Description

      Often I would like to see what fields are defined in a collection. Especially when doing maintenance in the shell.
      something like
      db.mycollection.getFields()
      to return all defined fields in all docs of a collection
      or
      db.mycol.getFields(

      {Field2 : 1}

      )
      get all fields from docs where Field2 is defined in the doc
      or
      db.mycol.findFields(

      {docType : "orderitems"}

      )
      get all fields from docs where the docType Field is defined and contains the value of "orderitems"

      Attachments

        Activity

          People

            backlog-server-query Backlog - Query Team (Inactive)
            middletommy Thomas Tucker
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: