[SERVER-2017] Query for field names in a collection Created: 27/Oct/10 Updated: 06/Dec/22 Resolved: 04/Dec/17 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Admin |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | New Feature | Priority: | Minor - P4 |
| Reporter: | Thomas Tucker | Assignee: | Backlog - Query Team (Inactive) |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||
| Assigned Teams: |
Query
|
||||
| Backwards Compatibility: | Fully Compatible | ||||
| Participants: | |||||
| Description |
|
Often I would like to see what fields are defined in a collection. Especially when doing maintenance in the shell. ) ) |
| Comments |
| Comment by Asya Kamsky [ 04/Dec/17 ] |
|
Doable via aggregation as of 3.4.4. |
| Comment by Asya Kamsky [ 04/Dec/17 ] |
|
This is possible to do in aggregation using "$objectToArray" (available in 3.4.4) - there is a write-up showing how to do it here for top level keys: http://www.askasya.com/post/getallkeys/. |