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

Add shell helpers for inclusion/exclusion field list

    XMLWordPrintableJSON

Details

    • Icon: Improvement Improvement
    • Resolution: Won't Do
    • Icon: Minor - P4 Minor - P4
    • None
    • None
    • Shell
    • None

    Description

      Many of the driver implementations have projection syntax which allows fields to be specified as a list/array or a hash/dictionary (default). It would be helpful if the mongo shell included similar syntactic sugar for including & excluding fields.

      A few examples:

      Conceptually this might be something similar to:

      	db.zips.find({state:'NY'}, includeFields("city","zip","pop"))
      

      Which would be equivalent to:

            db.zips.find({state:'NY'}, { "city" : 1, "zip" : 1, "pop" : 1 })
      

      Attachments

        Activity

          People

            backlog-server-platform DO NOT USE - Backlog - Platform Team
            stephen.steneker@mongodb.com Stennie Steneker (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: