Back
[SOLVED]How to get ID from Node server SDK to create unique ID , everytime I create a Document.
- 0
- Databases
- Web
I am writing a function, and I want to generate an unique ID to create a document, How to import ID from appwrite in Node Server SDK?
TL;DR
Solution:
To generate a unique ID every time you create a document using the Node Server SDK for Appwrite, you can use the `createDocument` function along with the `generateUUID` method provided by the SDK. Here's how you can do it:
1. Import the required modules:
```javascript
const { Client, Database } = require('appwrite');
```
2. Create a new instance of the `Client` and `Database` classes:
```javascript
const client = new Client();
const database = new Database(client);
```
3. Use the `generateUUID` method from the SDK to generate a uniqueHow to get ID from Node server SDK to create unique ID , everytime I create a Document.
Yes, Thanks sir 🙂
[SOLVED]How to get ID from Node server SDK to create unique ID , everytime I create a Document.
Recommended threads
- type generation on same columns in table
is there way to prevent this ? or only need to update column name like table prefix?
- Unable to send verification email
Hi! I’m trying to access my project on Appwrite Cloud (fra.cloud.appwrite.io), but I keep getting this popup saying: “To continue using Appwrite Cloud, please...
- Converting circularstructure to JSON
Hello 👋, when this will be fixed on Appwrite Sites? It's draining our quotas for Sentry, it must be a problem with the default logger which is always on for Ap...