Skip to content

beanie.odm.fields

Indexed

Indexed(typ, index_type=ASCENDING, **kwargs)

Returns a subclass of typ with an extra attribute _indexed as a tuple: - Index 0: index_type such as pymongo.ASCENDING - Index 1: kwargs passed to IndexModel When instantiated the type of the result will actually be typ.

PydanticObjectId

class PydanticObjectId(ObjectId)

Object Id field. Compatible with Pydantic.

ExpressionField

class ExpressionField(str)

ExpressionField.__getitem__

 | __getitem__(item)

Get sub field

Arguments:

  • item: name of the subfield

Returns:

ExpressionField

ExpressionField.__getattr__

 | __getattr__(item)

Get sub field

Arguments:

  • item: name of the subfield

Returns:

ExpressionField