{
  "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": "encryptedInt",
        "bsonType": "int",
        "queries": {
          "queryType": "range",
          "contention": {
            "$numberLong": "0"
          },
          "min": {
            "$numberInt": "0"
          },
          "max": {
            "$numberInt": "200"
          }
        }
      }
    ]
  },
  "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 applies defaults for trimFactor and sparsity",
      "clientOptions": {
        "autoEncryptOpts": {
          "kmsProviders": {
            "local": {
              "key": {
                "$binary": {
                  "base64": "Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk",
                  "subType": "00"
                }
              }
            }
          }
        }
      },
      "operations": [
        {
          "name": "insertOne",
          "arguments": {
            "document": {
              "_id": 0,
              "encryptedInt": {
                "$numberInt": "0"
              }
            }
          }
        },
        {
          "name": "insertOne",
          "arguments": {
            "document": {
              "_id": 1,
              "encryptedInt": {
                "$numberInt": "1"
              }
            }
          }
        },
        {
          "name": "find",
          "arguments": {
            "filter": {
              "encryptedInt": {
                "$gt": {
                  "$numberInt": "0"
                }
              }
            }
          },
          "result": [
            {
              "_id": 1,
              "encryptedInt": {
                "$numberInt": "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,
                  "encryptedInt": {
                    "$$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": "encryptedInt",
                        "bsonType": "int",
                        "queries": {
                          "queryType": "range",
                          "contention": {
                            "$numberLong": "0"
                          },
                          "min": {
                            "$numberInt": "0"
                          },
                          "max": {
                            "$numberInt": "200"
                          }
                        }
                      }
                    ]
                  }
                }
              }
            },
            "command_name": "insert"
          }
        },
        {
          "command_started_event": {
            "command": {
              "insert": "default",
              "documents": [
                {
                  "_id": 1,
                  "encryptedInt": {
                    "$$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": "encryptedInt",
                        "bsonType": "int",
                        "queries": {
                          "queryType": "range",
                          "contention": {
                            "$numberLong": "0"
                          },
                          "min": {
                            "$numberInt": "0"
                          },
                          "max": {
                            "$numberInt": "200"
                          }
                        }
                      }
                    ]
                  }
                }
              }
            },
            "command_name": "insert"
          }
        },
        {
          "command_started_event": {
            "command": {
              "find": "default",
              "filter": {
                "encryptedInt": {
                  "$gt": {
                    "$binary": {
                      "base64": "[encoded data, 9252 characters]",
                      "subType": "06"
                    }
                  }
                }
              },
              "encryptionInformation": {
                "type": 1,
                "schema": {
                  "default.default": {
                    "escCollection": "enxcol_.default.esc",
                    "ecocCollection": "enxcol_.default.ecoc",
                    "fields": [
                      {
                        "keyId": {
                          "$binary": {
                            "base64": "EjRWeBI0mHYSNBI0VniQEg==",
                            "subType": "04"
                          }
                        },
                        "path": "encryptedInt",
                        "bsonType": "int",
                        "queries": {
                          "queryType": "range",
                          "contention": {
                            "$numberLong": "0"
                          },
                          "min": {
                            "$numberInt": "0"
                          },
                          "max": {
                            "$numberInt": "200"
                          }
                        }
                      }
                    ]
                  }
                }
              }
            },
            "command_name": "find"
          }
        }
      ],
      "outcome": {
        "collection": {
          "data": [
            {
              "_id": 0,
              "encryptedInt": {
                "$$type": "binData"
              },
              "__safeContent__": [
                {
                  "$binary": {
                    "base64": "RjBYT2h3ZAoHxhf8DU6/dFbDkEBZp0IxREcsRTu2MXs=",
                    "subType": "00"
                  }
                },
                {
                  "$binary": {
                    "base64": "+vC6araOEo+fpW7PSIP40/EnzBCj1d2N10Jr3rrXJJM=",
                    "subType": "00"
                  }
                }
              ]
            },
            {
              "_id": {
                "$numberInt": "1"
              },
              "encryptedInt": {
                "$$type": "binData"
              },
              "__safeContent__": [
                {
                  "$binary": {
                    "base64": "25j9sQXZCihCmHKvTHgaBsAVZFcGPn7JjHdrCGlwyyw=",
                    "subType": "00"
                  }
                },
                {
                  "$binary": {
                    "base64": "SlNHXyqVFGDPrX/2ppwog6l4pwj3PKda2TkZbqgfSfA=",
                    "subType": "00"
                  }
                }
              ]
            }
          ]
        }
      }
    }
  ]
}
