neosqlite.collection.query_helper.schema_validator module

Native JSON Schema validator for NeoSQLite. Provides MongoDB-compatible $jsonSchema evaluation.

neosqlite.collection.query_helper.schema_validator.matches_json_schema(document: dict[str, Any], schema: dict[str, Any]) bool[source]

Check if a document matches the provided JSON Schema.

Parameters:
  • document – The document to validate

  • schema – The JSON Schema specification

Returns:

True if the document matches the schema, False otherwise.

neosqlite.collection.query_helper.schema_validator._validate_node(data: Any, schema: Any) bool[source]

Recursively validate a data node against a schema node.

neosqlite.collection.query_helper.schema_validator._check_type(data: Any, type_spec: Any) bool[source]

Check if data matches the specified type or list of types.

neosqlite.collection.query_helper.schema_validator._check_single_type(data: Any, t: str) bool[source]

Check a single type string (supports both JSON Schema and BSON types).