[COMPASS-416] Creating multiple doc validations of the same field loses all validations except the last Created: 21/Nov/16  Updated: 10/Jan/24  Resolved: 05/Mar/19

Status: Closed
Project: Compass
Component/s: Document Validation
Affects Version/s: None
Fix Version/s: 1.18.0

Type: Bug Priority: Major - P3
Reporter: Peter Schmidt Assignee: Unassigned
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: PNG File First two rules go missing.png    
Issue Links:
Related

 Comments   
Comment by Massimiliano Marcon [ 05/Mar/19 ]

In 1.18 we introduced a new schema validation experience that completely replaces the old one. The first iteration only includes a smart editor with autocomplete, so this issue is definitely gone away.

Comment by Asya Kamsky [ 24/Sep/17 ]

Confirmed. It's extra bad if one of those is null-able as that embeds the rules into $or but then it $and's it with additional rule for the same field which basically means the $or expression will be no-op even though it'll be there:

{
  "$or": [
    {
      "b": {
        "$type": 2
      }
    },
    {
      "b": {
        "$exists": false
      }
    },
    {
      "b": null
    }
  ],
  "b": {
    "$regex": "^abc",
    "$options": ""
  }
}

Generated at Wed Feb 07 22:25:09 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.