[COMPASS-5173] Add expression to get value by keyname from object Created: 23/Sep/21  Updated: 16/Nov/21  Resolved: 19/Oct/21

Status: Closed
Project: Compass
Component/s: Autocomplete
Affects Version/s: None
Fix Version/s: 1.29.4

Type: Task Priority: Major - P3
Reporter: Jessica Sigafoos Assignee: Alena Khineika
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
is depended on by VSCODE-299 Add expression to get value by keynam... Closed
Documented
Duplicate
is duplicated by MONGOSH-1003 Add expression to get value by keynam... Closed
Problem/Incident
is caused by SERVER-30417 add expression to get value by keynam... Closed
Epic Link: COMPASS-4949
Story Points: 2
Documentation Changes: Needed
Sprint: Iteration Novokuybyshevsk

 Description   
Downstream Change Summary

Added a new aggregation expression, $getField: see the syntax document for more details: https://docs.google.com/document/d/1aXTM207O4b8Sj7C76f3A44dvCIXErgKB_u17XLnsxfk

Note that this is feature-flag guarded by featureFlagDotsAndDollars, which is currently disabled.

Description of Linked Ticket

While it's possible via combined use of $objectToArray and $filter with $map, it would be nice to have a simple expression to get value of particular field of an object:

db.foo.find()
{ _id: 1, a: 5, foo: { b: "a", c: 99.9 } }
db.foo.aggregate({$project:{ foo_c_is: {$getField:[ "c", "$foo" ] } } })
{ _id: 1, foo_c_is: 99.9 }

This will allow easily plucking out a value when the field name is stored in another part of the same document, or when it has some funny character that precludes it being used as subfield name (like leading "$") as in SERVER-30365 and SERVER-14466 or embedded '.' when querying oplog or system.profile collections.

Second argument could be optional and default to "$$ROOT".



 Comments   
Comment by Githook User [ 26/Oct/21 ]

Author:

{'name': 'Alena Khineika', 'email': 'alena.khineika@gmail.com', 'username': 'alenakhineika'}

Message: feat: bump ace-autocompleter to 0.8.0 COMPASS-5152, COMPASS-5173, COMPASS-5172 (#2519)

COMPASS-5152
COMPASS-5173
COMPASS-5172
Branch: compass-home-ts
https://github.com/mongodb-js/compass/commit/c59da1fd4b30cdb13a7e97b5210faac6775c124b

Comment by Githook User [ 19/Oct/21 ]

Author:

{'name': 'Alena Khineika', 'email': 'alena.khineika@gmail.com', 'username': 'alenakhineika'}

Message: feat: bump ace-autocompleter to 0.8.0 COMPASS-5152, COMPASS-5173, COMPASS-5172 (#2519)

COMPASS-5152
COMPASS-5173
COMPASS-5172
Branch: COMPASS-5053-loading-status
https://github.com/mongodb-js/compass/commit/c59da1fd4b30cdb13a7e97b5210faac6775c124b

Comment by Githook User [ 19/Oct/21 ]

Author:

{'name': 'Alena Khineika', 'email': 'alena.khineika@gmail.com', 'username': 'alenakhineika'}

Message: feat: bump ace-autocompleter to 0.8.0 COMPASS-5152, COMPASS-5173, COMPASS-5172 (#2519)

COMPASS-5152
COMPASS-5173
COMPASS-5172
Branch: main
https://github.com/mongodb-js/compass/commit/c59da1fd4b30cdb13a7e97b5210faac6775c124b

Comment by Githook User [ 18/Oct/21 ]

Author:

{'name': 'Alena Khineika', 'email': 'alena.khineika@gmail.com', 'username': 'alenakhineika'}

Message: feat: bump ace-autocompleter to 0.8.0 to support tsSecond, tsIncrement, densify, getfield

COMPASS-5152
COMPASS-5173
COMPASS-5172
Branch: add-tssecond-tsincrement-densify-getfield
https://github.com/mongodb-js/compass/commit/cf89fff0290b5a72e38e3c9ff962acd46b3ebabc

Generated at Wed Feb 07 22:38:42 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.