[DOCS-2341] Clarify $ifNull Behavior on Non-Existent Document Field Created: 04/Dec/13  Updated: 11/Jan/17  Resolved: 07/Dec/13

Status: Closed
Project: Documentation
Component/s: manual
Affects Version/s: None
Fix Version/s: 01112017-cleanup

Type: Task Priority: Major - P3
Reporter: Stephen Lee Assignee: Unassigned
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Participants:
Days since reply: 10 years, 11 weeks ago

 Description   

http://docs.mongodb.org/manual/reference/operator/aggregation/ifNull/#ifnull-aggregation

Consider

{$ifNull:["$thisFieldDoesNotExist",true]}

seems to consider the value of "$thisFieldDoesNotExist" as being null, so the expression evaluates to true.

Assuming this behavior is consistent across all Aggregation Framework-enabled versions, it'd be good to explicitly state this or include an example that shows this.


Generated at Thu Feb 08 07:43:14 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.