[SERVER-14726] Add shell helpers for inclusion/exclusion field list Created: 30/Jul/14  Updated: 26/Oct/21  Resolved: 26/Oct/21

Status: Closed
Project: Core Server
Component/s: Shell
Affects Version/s: None
Fix Version/s: None

Type: Improvement Priority: Minor - P4
Reporter: Stennie Steneker (Inactive) Assignee: DO NOT USE - Backlog - Platform Team
Resolution: Won't Do Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
Participants:

 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 })


Generated at Thu Feb 08 03:35:46 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.