Back

Bug on custom Document ID

  • 0
  • Databases
Bagios
27 Aug, 2024, 15:38

Basically, I was creating a new document in a collection, and I received this error, that the document ID already exist. This is not true, because the old document with the same ID has been deleted, but probably for some reasons it's still in memory. So, how to fix that?

TL;DR
Developers encountered a bug on custom Document ID where they received an error message about a document ID already existing when it had been deleted. The error message seems misleading and occurs when a unique index is violated. The issue arose due to a relationship inside the collection with another document being one-to-one. A suggested solution is to refresh and try again to resolve the problem.
Kenny
27 Aug, 2024, 16:12

If you refresh and try again what happens?

Bagios
27 Aug, 2024, 16:28

Nothing at all. But I discovered what happened, and it's a bug on the error displayed. Basically, there was a relationship inside the collection, with another document, one-to-one. And I was trying to add another document with the same relationship, and the one I shared above it's the error displayed.

ideclon
27 Aug, 2024, 17:25

Yeah, I’ve run into that before, I think

Joshi
27 Aug, 2024, 17:27

Also happens when unique index is being violated

Bagios
27 Aug, 2024, 22:13

I don’t have any index right now

Joshi
27 Aug, 2024, 22:16

Just wanted to say that you do get the same error message when a unique index is being violated. The error message is somewhat misleading in this case

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more