[DOCS-11528] Docs for SERVER-33757: Treat an illegal target type in $convert as an "onError" case Created: 03/Apr/18  Updated: 12/Jun/18  Resolved: 12/Jun/18

Status: Closed
Project: Documentation
Component/s: None
Affects Version/s: None
Fix Version/s: 3.7.4

Type: Task Priority: Major - P3
Reporter: Kay Kim (Inactive) Assignee: Kay Kim (Inactive)
Resolution: Duplicate Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Documented
documents SERVER-33757 Treat an illegal target type in $conv... Closed
Duplicate
duplicates DOCS-11386 Add $convert with support for typecas... Closed
Participants:
Days since reply: 5 years, 45 weeks, 2 days ago
Epic Link: DOCS: 4.0 Server

 Description   

Documentation Request Summary:

This ticket describes a minor change to how $convert handles "to" values that it doesn't support for conversion.

Engineering Ticket Description:

Currently, an illegal target type (e.g., "minKey") results in a query failure, even if there is an "onError" value. This means that attempting to pass the return value of a $type expression as the "to" parameter can result in a failure.

With this change, an invalid target type will instead return the "onError" value when it is present. Note that a string or number that does not map to any type will still result in an error in all cases.

 

Scope of changes:

None – we already doc (https://docs.mongodb.com/master/reference/operator/aggregation/convert/#exp._S_convert) for ``onError`` field description:

Optional. The value to return on encountering an error during conversion, including unsupported type conversions. The arguments can be any valid expression.

If unspecified, the operation throws an error upon encountering an error and stops.

Impact to other docs outside of this product:

MVP:

Resources:


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