Hi this may sound super stupid or maybe im doing it wrong cause im kinda new but this doesnt work from me:
import { ID } from 'appwrite';
async function rentarCasaOnetime() {
console.log(ID.unique())
}
The console.log returns:
unique() like if it was a string or something but it doesnt execute the function
it returns without the autogen id what is happening?
Summary
Title: ID.unique() not working; use UUID instead
- User mentions that ID.unique() function is not working for them.
- Another user suggests using the npm package 'uuid' to generate UUIDs instead.
- User asks if it is possible to return a string from the client side.
- User shares a link to the code that creates random IDs using the Utopia PHP framework.
- Another user clarifies that the ID generation happens on the server side, not the client side.
- User shares their code using ID.unique() and mentions that it returns 'unique()' as a string.
- User asks for assistance, as the
Binyamin
Rank 7: Quantum Computer
Mar 13, 2023, 21:42
I also wonder about it, but actually the function just returns a string and the AppWrite engine creating the ID on the machine and not on your end
Binyamin
Rank 7: Quantum Computer
Mar 13, 2023, 21:46
The actual functions that creates the random ID is part of the Utopia PHP framework which is maintained also by AppWrite,