MishoOriginal post
Rank 2: Process
JavaScript
import { Client, Databases, ID } from "appwrite";
const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') .setProject('<PROJECT_ID>');
const databases = new Databases(client);
const promise = databases.createDocument( '<DATABASE_ID>', '<COLLECTION_ID>', ID.unique(), { "title": "Hamlet" });
promise.then(function (response) { console.log(response);}, function (error) { console.log(error);});Is that ID.unique() thing really unique because i call this on server? for example waht if two users same time calling function that creates some doc based on that
Summary
- Developers are questioning the uniqueness of `ID.unique()` when creating a document on the server
- Slim chance of collision, no seen instances
- No issues even if two users call the function simultaneously