[SERVER-30988] Misleading error message when attempting to use $jsonSchema in aggregation Created: 07/Sep/17 Updated: 30/Oct/23 Resolved: 12/Sep/17 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Querying |
| Affects Version/s: | None |
| Fix Version/s: | 3.6.0-rc0 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | David Storch | Assignee: | Justin Seyster |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Backwards Compatibility: | Fully Compatible |
| Operating System: | ALL |
| Sprint: | Query 2017-09-11, Query 2017-10-02 |
| Participants: |
| Description |
|
The server can return an error message suggesting that FCV "3.6" must be set, despite the FCV already being set to "3.6":
The problem is that this error message is currently returned for any caller of the match expression parser which bans JSON Schema: https://github.com/mongodb/mongo/blob/master/src/mongo/db/matcher/expression_parser.cpp#L578-L585 This error message, however, should be specific to the collMod and create collection call sites which have FCV-related checks. Other call sites which may ban JSON Schema should have a more general message like "$jsonSchema not allowed in this context". |
| Comments |
| Comment by Ramon Fernandez Marina [ 12/Sep/17 ] |
|
Author: {'username': u'jseyster', 'name': u'Justin Seyster', 'email': u'justin.seyster@mongodb.com'}Message: My original implementation of the $jsonSchema ban included a Status There is a ticket open to enable $jsonSchema in more places: |
| Comment by Asya Kamsky [ 09/Sep/17 ] |
|
Never mind, I see |
| Comment by Asya Kamsky [ 09/Sep/17 ] |
|
Why is $jsonSchema banned in simple $match? |