Skip to content

Commit 7e219ab

Browse files
committed
DOCSP-48691 -- Changed code example to avoid incomplete number of documents in view with null values
1 parent 2587db7 commit 7e219ab

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

source/reference/known-issues.txt

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,4 +89,10 @@ the field ``$type`` is ``array`` with the ``createView`` method.
8989

9090
.. code-block:: javascript
9191

92-
db.createView('nonullsched', '"nextDeparture"', [{'$match': {'response.schedule': {'$type': 'array'}}}])
92+
db.createView("nextDeparture_view", "nextDeparture", [
93+
{
94+
"$project": {
95+
"response": { "$cond": { "if": { "$eq": ["$response.schedule", null] },
96+
"then": { }, "else": "$response" } }, "name": 1
97+
}
98+
} ])

0 commit comments

Comments
 (0)