[SERVER-33757] Treat an illegal target type in $convert as an "onError" case Created: 08/Mar/18  Updated: 29/Oct/23  Resolved: 21/Mar/18

Status: Closed
Project: Core Server
Component/s: Aggregation Framework
Affects Version/s: None
Fix Version/s: 3.7.4

Type: Improvement Priority: Major - P3
Reporter: Justin Seyster Assignee: Justin Seyster
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Documented
is documented by DOCS-11528 Docs for SERVER-33757: Treat an illeg... Closed
Backwards Compatibility: Fully Compatible
Sprint: Query 2018-03-12, Query 2018-03-26
Participants:

 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.



 Comments   
Comment by Githook User [ 21/Mar/18 ]

Author:

{'email': 'justin.seyster@mongodb.com', 'name': 'Justin Seyster', 'username': 'jseyster'}

Message: SERVER-33757 Unsupported target type in $convert is an "onError" case.
Branch: master
https://github.com/mongodb/mongo/commit/0db65652c2530ac0776e15e6c77911342a404793

Comment by Asya Kamsky [ 15/Mar/18 ]

So rather than "invalid" type, would it be more accurate to say this will return "onError" on unsupported "to" type?

Generated at Thu Feb 08 04:34:29 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.