[DOCS-14917] [Server] Valid conversion to Boolean are missing types Created: 04/Nov/21  Updated: 22/Jan/24

Status: Backlog
Project: Documentation
Component/s: manual, Server
Affects Version/s: None
Fix Version/s: None

Type: Task Priority: Minor - P4
Reporter: Natacha Bagnard Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: backlog, request
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Participants:
Days since reply: 28 weeks, 5 days ago

 Description   

In the documentation, the list of types supporting conversion to boolean does not match the implementation.
https://docs.mongodb.com/manual/reference/operator/aggregation/convert/
https://docs.mongodb.com/manual/reference/operator/aggregation/toBool/#mongodb-expression-exp.-toBool

All missing types except Undefined return true unconditionally :
https://github.com/10gen/mongo/blob/2fa18e5051b2c3487a9bc5fb8a38a96cdf52dbc0/src/mongo/db/pipeline/expression.cpp#L6129

Please let me know if you need more details.



 Comments   
Comment by Nick Villahermosa [ 21/Jul/23 ]

Non trivial, removed the quick-win and bug bash labels

Comment by Rea Rustagi [ 12/Jul/23 ]

natacha.bagnard@mongodb.com to clarify, does Undefined convert to false? I didn't see a conversion in the source code you linked. 

Generated at Thu Feb 08 08:11:31 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.