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

Query for field names in a collection

    • Type: Icon: New Feature New Feature
    • Resolution: Done
    • Priority: Icon: Minor - P4 Minor - P4
    • None
    • Affects Version/s: None
    • Component/s: Admin
    • None
    • Query
    • Fully Compatible

      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"

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

              Created:
              Updated:
              Resolved: