Schema not working as describe on documentation

You wouldn’t be able to have a dictionary-like object here. But if an array of each item as key-value pair works for you. You can do that by

"paymentObject": {
      "bsonType": "array",
      "items": {
        "bsonType": "object",
        "properties": {
          "key": {
            "bsonType": "string"
          },
          "value": {
            "bsonType": "string"
          }
        }
      }
    }
2 Likes