You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is there a way to automate relationships between documents in beanie or do you have to do it manually? If manually, are we able to access the ObjectId parameter of the document or should we just ensure that we have an index on a unique field? Also, can we set the unique field of an index to assist with this? I didn't see anything in the documentation about support of the unique flag of indexes. This may actually be multiple issues and let me know and I can split it up if you'd prefer.
The text was updated successfully, but these errors were encountered:
Yes, it is assumed to do it manually.
Every document contains id field - it is ObjectId (PydanticObjectId to be fair). You can use it to set the relations.
It is not documented. Nice catch - I'll clarify this.
Also, you can create a unique index. I'll show in example:
Is there a way to automate relationships between documents in beanie or do you have to do it manually? If manually, are we able to access the ObjectId parameter of the document or should we just ensure that we have an index on a unique field? Also, can we set the unique field of an index to assist with this? I didn't see anything in the documentation about support of the unique flag of indexes. This may actually be multiple issues and let me know and I can split it up if you'd prefer.
The text was updated successfully, but these errors were encountered: