neosqlite.collection.expr_evaluator.python_evaluators.type_ops module

Type conversion and BSON type Python evaluators.

class neosqlite.collection.expr_evaluator.python_evaluators.type_ops.TypePythonMixin[source]

Bases: BasePythonMixin

Type inspection/conversion operators and thin converter wrappers.

_evaluate_type_python(operator: str, operands: list[Any], document: dict[str, Any]) Any[source]

Evaluate type conversion operators in Python.

_convert_to_int() Any[source]

Convert value to int.

static _convert_to_long(value: Any) Any[source]

Convert value to long (64-bit int).

static _convert_to_double(value: Any) Any[source]

Convert value to double (float).

static _convert_to_decimal(value: Any) Any[source]

Convert value to decimal (float, as SQLite lacks Decimal128).

static _convert_to_string(value: Any) Any[source]

Convert value to string.

static _convert_to_bool(value: Any) Any[source]

Convert value to bool.

static _convert_to_objectid(value: Any) Any[source]

Convert value to ObjectId.

static _convert_to_bindata(value: Any) Any[source]

Convert value to Binary (binData).

static _convert_to_bsonbindata(value: Any) Any[source]

Convert value to Binary (bsonBinData).

static _convert_to_regex(value: Any) Any[source]

Convert value to regex pattern.

static _convert_to_bsonregex(value: Any) Any[source]

Convert value to regex pattern (bsonRegex).

static _convert_to_date(value: Any) Any[source]

Convert value to date.

static _convert_to_null(value: Any) None[source]

Convert any value to None.

_get_bson_type(value: Any) str[source]

Get BSON type name for a value.