title: Storing a JSON schema in mongodb with spring
body: <p>I am new to Spring data and mongodb. I have a JSON object which represents a JSON Schema and I need to store that in mongodb using spring data. But the issue with JSON schema is the structure of JSON Schema is dynamic; for example below are two valid JSON schema with completely different structure.</p>
  
  <pre><code>{
      "type": "object",
      "properties": {
          "name": {
              "type": "string",
              "minLength": 10
          },
          "age": {
              "type": "integer"
          }
      },
      "required": [
          "name",
          "age"
      ]
  }
  </code></pre>
  
  <hr>
  
  <pre><code>{
      "type": "array",
      "items": {
          "type": "object",
          "properties": {
              "abc": {
                  "type": "boolean"
              },
              "xyz": {
                  "$ref": "#/definitions/"
              },
              "asd": {
                  "type": "null"
              }
          },
          "required": [
              "abc",
              "xyz"
          ]
      }
  }
  </code></pre>
  
  <p>How can I define a JAVA POJO Class so that I can map the above JSON with the defined class and store it in mongodb. Or is it possible to do CURD operation in spring without mapping it to a POJO class?</p>