[DOCS-10924] Clarify if 'missing' is a BSON type in $type agg docs. Created: 20/Oct/17 Updated: 30/Oct/23 Resolved: 20/Oct/17 |
|
| Status: | Closed |
| Project: | Documentation |
| Component/s: | Server |
| Affects Version/s: | None |
| Fix Version/s: | Server_Docs_20231030 |
| Type: | Bug | Priority: | Minor - P4 |
| Reporter: | Dario Cantatore | Assignee: | Allison Reinheimer Moore |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | collector-298ba4e7 | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: | |||
| Participants: | |
| Days since reply: | 6 years, 12 weeks ago |
| Story Points: | 0.1 |
| Description |
|
The bson aggregation type missing is not shown in the docs but used in the examples. Is it a valid type or is there something else we should be using since undefined was deprecated? |
| Comments |
| Comment by Githook User [ 22/Nov/17 ] | |||||||||
|
Author: {'name': 'Allison Moore', 'username': 'schmalliso', 'email': 'allison.moore@10gen.com'}Message: | |||||||||
| Comment by Githook User [ 22/Nov/17 ] | |||||||||
|
Author: {'name': 'Allison Moore', 'username': 'schmalliso', 'email': 'allison.moore@10gen.com'}Message: | |||||||||
| Comment by Dario Cantatore [ 20/Oct/17 ] | |||||||||
|
Should this technically be a type in the table? Also, what do the type numbers apply to? Are they used? | |||||||||
| Comment by Allison Reinheimer Moore [ 20/Oct/17 ] | |||||||||
|
dario.cantatore@gmail.com If the field is non-existent then $type returns "missing". We do mention it under the $type heading in "Behavior"
That said, it's super easy to miss, so I'm adding the explanation below the Available Types section as well. Thanks! | |||||||||
| Comment by Dario Cantatore [ 20/Oct/17 ] | |||||||||
|
On this page: On the bottom it has:
If you had a cond in the group stage and you were checking for existence with something like:
is this valid for checking for a non existent value/field? It currently appears to be working correctly in my usage. But it is not listed on the table at the start of the page showing the 21 different types. |