This PR aims to introduce a way to declare indexed fields using python's Annotated, extending the current use of Indexed. It implements the syntax proposed in https://github.com/roman-right/beanie/issues/638.
It also supports the use of UUID and EmailStr when using Pydantic 2 and Annotated. Kinda solving https://github.com/roman-right/beanie/issues/701, though I couldn't reproduce the issue with PydanticObjectId.
This PR aims to introduce a way to declare indexed fields using python's
Annotated
, extending the current use ofIndexed
. It implements the syntax proposed in https://github.com/roman-right/beanie/issues/638.It also supports the use of
UUID
andEmailStr
when using Pydantic 2 andAnnotated
. Kinda solving https://github.com/roman-right/beanie/issues/701, though I couldn't reproduce the issue withPydanticObjectId
.