So I have two collections coops
and notification
my code above is trying to create a document inside the notifications
collection. The notification document requires an attribute called coopId which relates it to a document within the coops
collection the reason why I was getting the "Document with the requested ID already exists. Try again with a different ID or use ID.unique() to generate a unique ID." error is because the coopId
attribute's relation is set to one-to-one which was causing the error the solution was to set the attribute to many-to-one.