how to create document in database in the latest version #10662
Replies: 2 comments
|
The API was not removed; Appwrite now presents the new TablesDB terminology as the primary interface:
For the current Web SDK, create a row like this: import { Client, ID, TablesDB } from 'appwrite'
const client = new Client()
.setEndpoint('https://cloud.appwrite.io/v1')
.setProject(PROJECT_ID)
const tablesDB = new TablesDB(client)
const row = await tablesDB.createRow({
databaseId: DATABASE_ID,
tableId: TABLE_ID,
rowId: ID.unique(),
data: {
title: 'Hello',
published: true,
},
})Create the database/table and define its columns first in the Console or through a Server SDK. The client call will also be subject to table/row permissions and requires a valid Appwrite session when the permissions depend on the current user. If you are maintaining older code, the legacy If this is the missing create operation you were looking for, please mark the reply as accepted. |
Uh oh!
There was an error while loading. Please reload this page.
https://appwrite.io/docs/references/cloud/client-web/databases#createDocument here I cannot find how to create document section but the older versions have one
All reactions