#ID.unique() is just producing a string of "unique()"

7 messages · Page 1 of 1 (latest)

wicked turtle
#

ID.unique() indeed returns unique().
This when passed when creating a new document tells the server to generate a new ID for you. so in the response you would get the generated Id

sharp yew
#

thanks I'll give it a try.

I did try inserting ID.unique() , and "unique()" directly into the createDocument() but neither worked.

#

actually, that's what I already had and it didn't work

#

i must be doing something silly - i'll try again

terse bone
#

I'm facing this issue now. I wanted to create a user and a document with the same id, is that possible to really generate a unique id on the format that appwrite uses to I can reuse it?

wicked turtle
terse bone
#

Thanks @wicked turtle. If I don't have the id created yet, how can I set the permissions of a document when creating it on the server? How can I use the same id on all <id> placeholders on the below code

return await databases.createDocument(database, collectionUsers, <id>, {
      <id>,
      email,
      name,
    }, [
      Permission.read(Role.user(<id>)),
      Permission.write(Role.user(<id>)),
    ]);