-
Hi all, I have a FastAPI that I developed using a local mongo db instance, but when deploying the production environment in AWS using DocumentDB, I get the following error message: The error occurs during the application initialization, during the execution of "init_beanie": @app.on_event("startup")
async def startup_event():
request_id = str(uuid.uuid4())
logger.info(f"App startup. Request [{request_id}]].")
await init_beanie(
database=db,
document_models=[
User,
],
) Then, this is my definition for User model: class User(BeanieBaseUser[PydanticObjectId]):
first_name: Optional[str]
last_name: Optional[str]
affiliation: Optional[str]
studies: list = []
pass Has anyone else had success using beani with AWS DocumentDB? My DocumentDB cluster is version 4.0. I understand that Amazon's implementation of the MongoDB API is incomplete, but I'm not sure if this error is because of that or maybe it is something else. I'll appreciate it if you could share your experience with beani on AWS DocumentDB. Thank you |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
Hi all, I solved this issue by overriding the BeaniBaseUser internal Settings class. Here you have an example to remove the collation configuration: class User(BeanieBaseUser[PydanticObjectId]):
first_name: Optional[str]
last_name: Optional[str]
affiliation: Optional[str]
studies: list = []
class Settings:
email_collation = None
indexes = [
IndexModel("email", unique=True)
]
pass |
Beta Was this translation helpful? Give feedback.
Hi all,
I solved this issue by overriding the BeaniBaseUser internal Settings class. Here you have an example to remove the collation configuration: