NoSQL Validator

Validate a JSON document against a JSON Schema or MongoDB $jsonSchema

Load a matched document + schema, or paste your own.

Document

Schema (JSON Schema / $jsonSchema)

Result
VALID

The document matches the schema.

Examples

Validate a user document

Input
{ "name": "Ada", "age": 36 } against a schema requiring name (string) and age (int, min 0)
Output
VALID — both required fields are present and correctly typed.

Load the sample to see a document and a MongoDB $jsonSchema validator checked field by field.

Catch a wrong type

Input
{ "age": "thirty-six" } against { age: { bsonType: "int" } }
Output
age — Expected type int, got string.

The validator points at the exact field path so you can fix the document or the schema.

About this tool

Document stores such as MongoDB can enforce a shape at write time with a validator built from JSON Schema, or MongoDB's $jsonSchema. Authoring that schema by hand is error-prone, and a single wrong keyword silently lets bad data in.

Paste a document and a schema and the validator checks every node: the expected type (including BSON aliases like int and bool), required properties, additionalProperties:false, array items, enum membership, string minLength/maxLength and pattern, and numeric minimum/maximum. Each failure points at the exact field path. It supports a practical subset of draft-07 plus MongoDB bsonType and the $jsonSchema wrapper.

How to use

  1. Paste the document

    Enter the JSON document you want to validate on the left.

  2. Paste the schema

    Enter a JSON Schema, optionally wrapped in { "$jsonSchema": { ... } }, on the right.

  3. Read the result

    A VALID badge means it matches; otherwise each error names the offending field path and why.

  4. Iterate

    Fix the document or correct the schema and the result updates live.

Common mistakes

Mistake:Forgetting required.

Fix:Listing a property in properties does not make it required — add its name to the required array.

Mistake:Using 'number' when MongoDB wants 'int'.

Fix:Use bsonType (e.g. 'int', 'long', 'double') for MongoDB validators; this tool understands both.

Frequently asked questions

References & standards