-
Type: Task
-
Resolution: Fixed
-
Priority: Minor - P4
-
Affects Version/s: None
-
Component/s: Docs, Docs Examples
The documentation team would like to add a new example to the Project Fields to Return from Query Results page
Acceptance Criteria
- Add following code (translated to node) in the examples section of the codebase
- Translate the following code sample into Node Driver syntax
db.inventory.find( { }, { _id: 0, item: 1, status: { $switch: { branches: [ { case: { $eq: [ "$status", "A" ] }, then: "Available" }, { case: { $eq: [ "$status", "D" ] }, then: "Discontinued" }, ], default: "No status found" } }, area: { $concat: [ { $toString: { $multiply: [ "$size.h", "$size.w" ] } }, " ", "$size.uom" ] }, reportNumber: { $literal: 1 } } )
- Add in code comments so that the code looks like this:
// Start Aggregation Projection Example 1 <example code> // End Aggregation Projection Example 1