79363731

Date: 2025-01-17 05:43:05
Score: 1
Natty:
Report link

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.

Reasons:
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Single line (0.5):
  • Low reputation (1):
Posted by: Diane Gutierrez