#[SOLVED] ID.unique() doesn't work

59 messages · Page 1 of 1 (latest)

pale star
#

When I call ID.unique() a string 'unique()' is returned
I tried logging ID and the cause might be the quotes

obsidian plover
#

What's the problem? I don't think I understood

pale star
#

So this was the error that I first encountered

#

query used

#

I thought somethign would be wrong with the ID gen but then I also triied using uuid package which is giving a similar error

obsidian plover
#

Can you replace Id.unique() function with a simple string 'unique()'

pale star
#

sure

#

I still get th error

obsidian plover
#

Can you open the network tab and show me the request body

pale star
#

I have got similar query for boards which works

obsidian plover
#

Do you have any indexes on this collection?

#

The sounds collection

pale star
#

none, but there are relatiosn in attributes

shadow wave
obsidian plover
pale star
obsidian plover
#

Is that a unique index?

pale star
pale star
#

does it cause problems?

obsidian plover
pale star
#

I just have one index on users table

#

Should I try removing the index

pale star
obsidian plover
pale star
#

still gives the error

shadow wave
#

And do you have imported ID from Appwrite?

pale star
#

yes I have imported ID from Appwrite

#

also using the same qeury I have boards being created that works as expected

#

Fo reference to this error,
The only chnages I made to attributes is firstly relations between the tables, then the indexing of email and lastly changed sounds to be deleted ie cascade when board is dleted

shadow wave
#

Nevermind, the variable is correct

#

Oh, wait, what's it. Could you please send it?

#

Or an example?

shadow wave
#

name contains just name?

#

It should be like a JSON. Something like this:

{
"name": "D5"
}
pale star
#

name is a string and is getting parsed correctly, my issue lies with a specific collection which throws error mentioned before

#

Something I tried is I created a new user and this allowed me to upload/save a document(sound) but the secodn time its throws an error

#

is the ID caching in the backend or someting

shadow wave
#

Looks like this:

{
name: "D5"
}
#

Not sure if it's due to browser interpretation or similar 😅

#

Are you using Appwrite cloud or self-hosting?

pale star
#

should be that cause in DB it is correct

shadow wave
#

What's the part of the code where you set the variable?

pale star
pale star
#

This issue got my head scratching, but finally I realised what was wrong, the error message was right but it should've been more verbose
My Sounds collection has one to one relation with user, this caused the error to occur, idk how this didn't happen before when I was testing . Anyways thanks.
Hwo can I close this thread

shadow wave
#

I'm closing it. Makes sense, didn't have thought about the relationship 😅

shadow wave
#

[SOLVED] ID.unique() doesn't work

obsidian plover