{
  "runOn": [
    {
      "minServerVersion": "8.0.0",
      "topology": [
        "replicaset",
        "sharded",
        "load-balanced"
      ]
    }
  ],
  "database_name": "default",
  "collection_name": "default",
  "data": [],
  "encrypted_fields": {
    "fields": [
      {
        "keyId": {
          "$binary": {
            "base64": "EjRWeBI0mHYSNBI0VniQEg==",
            "subType": "04"
          }
        },
        "path": "encryptedDecimalPrecision",
        "bsonType": "decimal",
        "queries": {
          "queryType": "range",
          "contention": {
            "$numberLong": "0"
          },
          "trimFactor": {
            "$numberInt": "1"
          },
          "sparsity": {
            "$numberLong": "1"
          },
          "min": {
            "$numberDecimal": "0.0"
          },
          "max": {
            "$numberDecimal": "200.0"
          },
          "precision": {
            "$numberInt": "2"
          }
        }
      }
    ]
  },
  "key_vault_data": [
    {
      "_id": {
        "$binary": {
          "base64": "EjRWeBI0mHYSNBI0VniQEg==",
          "subType": "04"
        }
      },
      "keyMaterial": {
        "$binary": {
          "base64": "sHe0kz57YW7v8g9VP9sf/+K1ex4JqKc5rf/URX3n3p8XdZ6+15uXPaSayC6adWbNxkFskuMCOifDoTT+rkqMtFkDclOy884RuGGtUysq3X7zkAWYTKi8QAfKkajvVbZl2y23UqgVasdQu3OVBQCrH/xY00nNAs/52e958nVjBuzQkSb1T8pKJAyjZsHJ60+FtnfafDZSTAIBJYn7UWBCwQ==",
          "subType": "00"
        }
      },
      "creationDate": {
        "$date": {
          "$numberLong": "1648914851981"
        }
      },
      "updateDate": {
        "$date": {
          "$numberLong": "1648914851981"
        }
      },
      "status": {
        "$numberInt": "0"
      },
      "masterKey": {
        "provider": "local"
      }
    }
  ],
  "tests": [
    {
      "description": "FLE2 Range DecimalPrecision. FindOneAndUpdate.",
      "clientOptions": {
        "autoEncryptOpts": {
          "kmsProviders": {
            "local": {
              "key": {
                "$binary": {
                  "base64": "Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk",
                  "subType": "00"
                }
              }
            }
          }
        }
      },
      "operations": [
        {
          "name": "insertOne",
          "arguments": {
            "document": {
              "_id": 0,
              "encryptedDecimalPrecision": {
                "$numberDecimal": "0"
              }
            }
          }
        },
        {
          "name": "insertOne",
          "arguments": {
            "document": {
              "_id": 1,
              "encryptedDecimalPrecision": {
                "$numberDecimal": "1"
              }
            }
          }
        },
        {
          "name": "findOneAndUpdate",
          "arguments": {
            "filter": {
              "encryptedDecimalPrecision": {
                "$gt": {
                  "$numberDecimal": "0"
                }
              }
            },
            "update": {
              "$set": {
                "encryptedDecimalPrecision": {
                  "$numberDecimal": "2"
                }
              }
            },
            "returnDocument": "Before"
          },
          "result": {
            "_id": 1,
            "encryptedDecimalPrecision": {
              "$numberDecimal": "1"
            }
          }
        }
      ],
      "expectations": [
        {
          "command_started_event": {
            "command": {
              "listCollections": 1,
              "filter": {
                "name": "default"
              }
            },
            "command_name": "listCollections"
          }
        },
        {
          "command_started_event": {
            "command": {
              "find": "datakeys",
              "filter": {
                "$or": [
                  {
                    "_id": {
                      "$in": [
                        {
                          "$binary": {
                            "base64": "EjRWeBI0mHYSNBI0VniQEg==",
                            "subType": "04"
                          }
                        }
                      ]
                    }
                  },
                  {
                    "keyAltNames": {
                      "$in": []
                    }
                  }
                ]
              },
              "$db": "keyvault",
              "readConcern": {
                "level": "majority"
              }
            },
            "command_name": "find"
          }
        },
        {
          "command_started_event": {
            "command": {
              "insert": "default",
              "documents": [
                {
                  "_id": 0,
                  "encryptedDecimalPrecision": {
                    "$$type": "binData"
                  }
                }
              ],
              "ordered": true,
              "encryptionInformation": {
                "type": 1,
                "schema": {
                  "default.default": {
                    "escCollection": "enxcol_.default.esc",
                    "ecocCollection": "enxcol_.default.ecoc",
                    "fields": [
                      {
                        "keyId": {
                          "$binary": {
                            "base64": "EjRWeBI0mHYSNBI0VniQEg==",
                            "subType": "04"
                          }
                        },
                        "path": "encryptedDecimalPrecision",
                        "bsonType": "decimal",
                        "queries": {
                          "queryType": "range",
                          "contention": {
                            "$numberLong": "0"
                          },
                          "trimFactor": {
                            "$numberInt": "1"
                          },
                          "sparsity": {
                            "$numberLong": "1"
                          },
                          "min": {
                            "$numberDecimal": "0.0"
                          },
                          "max": {
                            "$numberDecimal": "200.0"
                          },
                          "precision": {
                            "$numberInt": "2"
                          }
                        }
                      }
                    ]
                  }
                }
              }
            },
            "command_name": "insert"
          }
        },
        {
          "command_started_event": {
            "command": {
              "insert": "default",
              "documents": [
                {
                  "_id": 1,
                  "encryptedDecimalPrecision": {
                    "$$type": "binData"
                  }
                }
              ],
              "ordered": true,
              "encryptionInformation": {
                "type": 1,
                "schema": {
                  "default.default": {
                    "escCollection": "enxcol_.default.esc",
                    "ecocCollection": "enxcol_.default.ecoc",
                    "fields": [
                      {
                        "keyId": {
                          "$binary": {
                            "base64": "EjRWeBI0mHYSNBI0VniQEg==",
                            "subType": "04"
                          }
                        },
                        "path": "encryptedDecimalPrecision",
                        "bsonType": "decimal",
                        "queries": {
                          "queryType": "range",
                          "contention": {
                            "$numberLong": "0"
                          },
                          "trimFactor": {
                            "$numberInt": "1"
                          },
                          "sparsity": {
                            "$numberLong": "1"
                          },
                          "min": {
                            "$numberDecimal": "0.0"
                          },
                          "max": {
                            "$numberDecimal": "200.0"
                          },
                          "precision": {
                            "$numberInt": "2"
                          }
                        }
                      }
                    ]
                  }
                }
              }
            },
            "command_name": "insert"
          }
        },
        {
          "command_started_event": {
            "command": {
              "findAndModify": "default",
              "query": {
                "encryptedDecimalPrecision": {
                  "$gt": {
                    "$binary": {
                      "base64": "DRYKAAADcGF5bG9hZACiCQAABGcAjgkAAAMwAH0AAAAFZAAgAAAAAHdJ2Vnb4MMzqVYVssjSdDy8XU4GVzMTfGifGETgQ2mYBXMAIAAAAAD7cFfKJGIXo6PjyeX2ria02CckW7dWFDoY/3FyBdm1NQVsACAAAAAAhEPSNv4M023A3hzNFuy83+hIKuZ2mKRY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AAAAAAAAAAAAAAPjAA",
                      "subType": "06"
                    }
                  }
                }
              },
              "update": {
                "$set": {
                  "encryptedDecimalPrecision": {
                    "$$type": "binData"
                  }
                }
              },
              "encryptionInformation": {
                "type": 1,
                "schema": {
                  "default.default": {
                    "escCollection": "enxcol_.default.esc",
                    "ecocCollection": "enxcol_.default.ecoc",
                    "fields": [
                      {
                        "keyId": {
                          "$binary": {
                            "base64": "EjRWeBI0mHYSNBI0VniQEg==",
                            "subType": "04"
                          }
                        },
                        "path": "encryptedDecimalPrecision",
                        "bsonType": "decimal",
                        "queries": {
                          "queryType": "range",
                          "contention": {
                            "$numberLong": "0"
                          },
                          "trimFactor": {
                            "$numberInt": "1"
                          },
                          "sparsity": {
                            "$numberLong": "1"
                          },
                          "min": {
                            "$numberDecimal": "0.0"
                          },
                          "max": {
                            "$numberDecimal": "200.0"
                          },
                          "precision": {
                            "$numberInt": "2"
                          }
                        }
                      }
                    ]
                  }
                }
              }
            },
            "command_name": "findAndModify"
          }
        }
      ],
      "outcome": {
        "collection": {
          "data": [
            {
              "_id": {
                "$numberInt": "0"
              },
              "encryptedDecimalPrecision": {
                "$$type": "binData"
              },
              "__safeContent__": [
                {
                  "$binary": {
                    "base64": "Dri0CXmL78L2DOgk9w0DwxHOMGMzih7m6l59vgy+WWo=",
                    "subType": "00"
                  }
                },
                {
                  "$binary": {
                    "base64": "x7GR49EN0t3WXQDihkrbonK7qNIBYC87tpL/XEUyIYc=",
                    "subType": "00"
                  }
                },
                {
                  "$binary": {
                    "base64": "JfYUqWF+OoGjiYkRI4L5iPlF+T1Eleul7Fki22jp4Qc=",
                    "subType": "00"
                  }
                },
                {
                  "$binary": {
                    "base64": "q1RyGfIgsaQHoZFRw+DD28V26rN5hweApPLwExncvT8=",
                    "subType": "00"
                  }
                },
                {
                  "$binary": {
                    "base64": "L2PFeKGvLS6C+DLudR6fGlBq3ERPvjWvRyNRIA2HVb0=",
                    "subType": "00"
                  }
                },
                {
                  "$binary": {
                    "base64": "CWxaNqL3iP1yCixDkcmf9bmW3E5VeN8TJkg1jJe528s=",
                    "subType": "00"
                  }
                },
                {
                  "$binary": {
                    "base64": "+vC6araOEo+fpW7PSIP40/EnzBCj1d2N10Jr3rrXJJM=",
                    "subType": "00"
                  }
                },
                {
                  "$binary": {
                    "base64": "6SV63Mf51Z6A6p2X3rCnJKCu6ku3Oeb45mBYbz+IoAo=",
                    "subType": "00"
                  }
                },
                {
                  "$binary": {
                    "base64": "RjBYT2h3ZAoHxhf8DU6/dFbDkEBZp0IxREcsRTu2MXs=",
                    "subType": "00"
                  }
                },
                {
                  "$binary": {
                    "base64": "b7d8mRzD1kI1tdc7uNL+YAUonJ6pODLsRLkArfEKSkM=",
                    "subType": "00"
                  }
                },
                {
                  "$binary": {
                    "base64": "Xg8C1/A0KJaXOw4i+26Rv03/CydaaunOzXh0CIT+gn8=",
                    "subType": "00"
                  }
                },
                {
                  "$binary": {
                    "base64": "UoKUDw2wJYToUCcFaIs03YQSTksYR0MIOTJllwODqKc=",
                    "subType": "00"
                  }
                },
                {
                  "$binary": {
                    "base64": "c/5cwAT0C5jber2xlJnWD3a5tVDy0nRtr5HG02hoFOY=",
                    "subType": "00"
                  }
                },
                {
                  "$binary": {
                    "base64": "wSUrRXavAGaajNeqC5mEUH1K67oYl5Wy9RNIzKjwLAM=",
                    "subType": "00"
                  }
                },
                {
                  "$binary": {
                    "base64": "6vrp4wWDtHEgHWR99I70WVDzevg1Fk/Pw5U8gUDa0OU=",
                    "subType": "00"
                  }
                }
              ]
            },
            {
              "_id": {
                "$numberInt": "1"
              },
              "encryptedDecimalPrecision": {
                "$$type": "binData"
              },
              "__safeContent__": [
                {
                  "$binary": {
                    "base64": "V6knyt7Zq2CG3++l75UtBx2m32iGAPjHiAe439Bf02w=",
                    "subType": "00"
                  }
                },
                {
                  "$binary": {
                    "base64": "F08nMDWDZc+DbWM7XCEJNNCEYyinRmrvGP7EWhmp4is=",
                    "subType": "00"
                  }
                },
                {
                  "$binary": {
                    "base64": "cXH4688amcDc8kZOJq4UP8cE3R58Zl7e+Qo/1jyspps=",
                    "subType": "00"
                  }
                },
                {
                  "$binary": {
                    "base64": "uURBxvTp3FBCVkd+LPqyuY7d6rMW6SGIJQEPY/wtkZI=",
                    "subType": "00"
                  }
                },
                {
                  "$binary": {
                    "base64": "jG3hax1L3RBp9t38vUt53FsBxgr/+Si/vVISpAylYpE=",
                    "subType": "00"
                  }
                },
                {
                  "$binary": {
                    "base64": "kwtIW8MhH9Ky5xNjBx8gFA/SHh2YVphie7g5FGBzals=",
                    "subType": "00"
                  }
                },
                {
                  "$binary": {
                    "base64": "FHflwFuEMu4xX0ZApHi+pdlBH+oevAtXckCUb5Wv0xU=",
                    "subType": "00"
                  }
                },
                {
                  "$binary": {
                    "base64": "0OKSXELxPP85SBVwDGf3LtMEQCJ8TTkFUl/+6jlkdb0=",
                    "subType": "00"
                  }
                },
                {
                  "$binary": {
                    "base64": "25j9sQXZCihCmHKvTHgaBsAVZFcGPn7JjHdrCGlwyyw=",
                    "subType": "00"
                  }
                },
                {
                  "$binary": {
                    "base64": "uEw0lpQtBppR3vqV9j9+NQRSBF1BzZukb8c9IhyWvxc=",
                    "subType": "00"
                  }
                },
                {
                  "$binary": {
                    "base64": "zVhZ7Q59O087ji49oMJvBIgeir2oqvUpnh4p53GcTow=",
                    "subType": "00"
                  }
                },
                {
                  "$binary": {
                    "base64": "dowrzKs+qJhRMZyKDbhjXbuX43FbmUKOaw9I8YlOZDw=",
                    "subType": "00"
                  }
                },
                {
                  "$binary": {
                    "base64": "ep5B6cska6THLIF7Mn3tn3RvV9EiwLSt0eZM/CLRUDc=",
                    "subType": "00"
                  }
                },
                {
                  "$binary": {
                    "base64": "URNp/YmmDh5wIZUfAzzgPyJeMNiVx9PMsz52DZRujGY=",
                    "subType": "00"
                  }
                },
                {
                  "$binary": {
                    "base64": "wlM4IAQhhKQEzoVqS8b1Ddd50GB95OFb9LnzOwyjCP4=",
                    "subType": "00"
                  }
                }
              ]
            }
          ]
        }
      }
    }
  ]
}
