-
Type: Improvement
-
Resolution: Unresolved
-
Priority: Minor - P4
-
None
-
Affects Version/s: None
-
Component/s: StrictFilter, TypeScript
-
Not Needed
Use Case
As a typescript user I want to create dot notation keys from string interpolation that can be verified against a type that checks the total string as a valid nested specifier.
This would help work around the issue reported in NODE-4933.
User example
Unable to find source-code formatter for language: typescript. Available languages are: actionscript, ada, applescript, bash, c, c#, c++, cpp, css, erlang, go, groovy, haskell, html, java, javascript, js, json, lua, none, nyan, objc, perl, php, python, r, rainbow, ruby, scala, sh, sql, swift, visualbasic, xml, yaml
type Pet = { name: string; attributes: { bestFriends: Array<{ _id: Date; name: string }> } } let newName = 'spot' for (let i = 0; i < friends.length; i++) { const nestedKey: NestedKey<TSchema> = `attributes.bestFriends.${i}.name` // NestedKey here provides an assertion that the calculated key is correct const $set: Document = { [nestedKey]: newName } await pets.updateOne({}, { $set }) }
Dependencies
- upstream and/or downstream requirements and timelines to bear in mind
Unknowns
- questions that need to be answered to determine implementation
Acceptance Criteria
Implementation Requirements
- functional reqs, potential snafus to avoid, performance targets, etc
Testing Requirements
- unit test, spec test sync, etc
Documentation Requirements
- DOCSP ticket, API docs, etc
Follow Up Requirements
- additional tickets to file, required releases, etc
- related to
-
NODE-4933 Type error when interpolating field name in $set
- Closed