motorhead.operator
All
Bases: KeyValueOperator
$all
MongoDB operator.
Source code in motorhead/operator.py
__init__(key, value)
Initialization.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
key
|
str | Field
|
The operator's key (the document attribute name). |
required |
value
|
list[Any]
|
The operator's value. |
required |
Source code in motorhead/operator.py
And
ClauseOperator
Base class for clause sequence based operators.
Source code in motorhead/operator.py
clauses
property
Generator that yields the operator's clauses.
__init__(*clauses)
DirectEq
ElemMatch
Bases: KeyValueOperator
$elemMatch
MongoDB operator.
Source code in motorhead/operator.py
__init__(key, value)
Initialization.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
key
|
str | Field
|
The operator's key (the document attribute name). |
required |
value
|
dict[str, Any]
|
The operator's value. |
required |
Source code in motorhead/operator.py
Eq
Exists
Bases: KeyValueOperator
$exists
MongoDB operator.
Source code in motorhead/operator.py
__init__(key, value)
Initialization.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
key
|
str | Field
|
The operator's key (the document attribute name). |
required |
value
|
bool
|
The operator's value. |
required |
Source code in motorhead/operator.py
Gt
Gte
In
KeyValueOperator
Base class for key-value pair based operators.
Source code in motorhead/operator.py
key
property
The operator's key (the document attribute name).
value
property
The operator's value.
__init__(key, value)
Initialization.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
key
|
str | Field
|
The operator's key (the document attribute name). |
required |
value
|
Any
|
The operator's value. |
required |
Source code in motorhead/operator.py
Lt
Lte
Ne
Nor
Not
NotIn
Or
Raw
Clause that wraps a raw, MongoDB query dict.
Source code in motorhead/operator.py
__init__(value)
Initialization.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
value
|
dict[str, Any]
|
The raw MongoDB query dict. |
required |
Regex
Bases: KeyValueOperator
$regex
MongoDB operator.
Source code in motorhead/operator.py
__init__(key, value)
Initialization.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
key
|
str | Field
|
The operator's key (the document attribute name). |
required |
value
|
str
|
The operator's value. |
required |
Source code in motorhead/operator.py
Size
Bases: KeyValueOperator
$size
MongoDB operator.
Source code in motorhead/operator.py
__init__(key, value)
Initialization.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
key
|
str | Field
|
The operator's key (the document attribute name). |
required |
value
|
int
|
The operator's value. |
required |
Source code in motorhead/operator.py
Type
Bases: KeyValueOperator
$type
MongoDB operator.
Source code in motorhead/operator.py
__init__(key, value)
Initialization.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
key
|
str | Field
|
The operator's key (the document attribute name). |
required |
value
|
str
|
The operator's value. |
required |