mirror of
https://github.com/appwrite/appwrite.git
synced 2026-05-26 13:51:13 +00:00
feat: update examples
This commit is contained in:
@@ -7,7 +7,11 @@ const client = new Client()
|
||||
const account = new Account(client);
|
||||
|
||||
const result = await account.updatePrefs({
|
||||
prefs: {}
|
||||
prefs: {
|
||||
"language": "en",
|
||||
"timezone": "UTC",
|
||||
"darkTheme": true
|
||||
}
|
||||
});
|
||||
|
||||
console.log(result);
|
||||
|
||||
@@ -10,7 +10,13 @@ const result = await databases.createDocument({
|
||||
databaseId: '<DATABASE_ID>',
|
||||
collectionId: '<COLLECTION_ID>',
|
||||
documentId: '<DOCUMENT_ID>',
|
||||
data: {},
|
||||
data: {
|
||||
"username": "walter.obrien",
|
||||
"email": "walter.obrien@example.com",
|
||||
"fullName": "Walter O'Brien",
|
||||
"age": 30,
|
||||
"isAdmin": false
|
||||
},
|
||||
permissions: ["read("any")"] // optional
|
||||
});
|
||||
|
||||
|
||||
+2
-2
@@ -11,8 +11,8 @@ const result = await databases.decrementDocumentAttribute({
|
||||
collectionId: '<COLLECTION_ID>',
|
||||
documentId: '<DOCUMENT_ID>',
|
||||
attribute: '',
|
||||
value: null, // optional
|
||||
min: null // optional
|
||||
value: 0, // optional
|
||||
min: 0 // optional
|
||||
});
|
||||
|
||||
console.log(result);
|
||||
|
||||
+2
-2
@@ -11,8 +11,8 @@ const result = await databases.incrementDocumentAttribute({
|
||||
collectionId: '<COLLECTION_ID>',
|
||||
documentId: '<DOCUMENT_ID>',
|
||||
attribute: '',
|
||||
value: null, // optional
|
||||
max: null // optional
|
||||
value: 0, // optional
|
||||
max: 0 // optional
|
||||
});
|
||||
|
||||
console.log(result);
|
||||
|
||||
@@ -9,7 +9,7 @@ const storage = new Storage(client);
|
||||
const result = await storage.createFile({
|
||||
bucketId: '<BUCKET_ID>',
|
||||
fileId: '<FILE_ID>',
|
||||
file: await pickSingle(),
|
||||
file: InputFile.fromPath('/path/to/file', 'filename'),
|
||||
permissions: ["read("any")"] // optional
|
||||
});
|
||||
|
||||
|
||||
@@ -10,7 +10,13 @@ const result = await tablesDB.createRow({
|
||||
databaseId: '<DATABASE_ID>',
|
||||
tableId: '<TABLE_ID>',
|
||||
rowId: '<ROW_ID>',
|
||||
data: {},
|
||||
data: {
|
||||
"username": "walter.obrien",
|
||||
"email": "walter.obrien@example.com",
|
||||
"fullName": "Walter O'Brien",
|
||||
"age": 30,
|
||||
"isAdmin": false
|
||||
},
|
||||
permissions: ["read("any")"] // optional
|
||||
});
|
||||
|
||||
|
||||
@@ -11,8 +11,8 @@ const result = await tablesDB.decrementRowColumn({
|
||||
tableId: '<TABLE_ID>',
|
||||
rowId: '<ROW_ID>',
|
||||
column: '',
|
||||
value: null, // optional
|
||||
min: null // optional
|
||||
value: 0, // optional
|
||||
min: 0 // optional
|
||||
});
|
||||
|
||||
console.log(result);
|
||||
|
||||
@@ -11,8 +11,8 @@ const result = await tablesDB.incrementRowColumn({
|
||||
tableId: '<TABLE_ID>',
|
||||
rowId: '<ROW_ID>',
|
||||
column: '',
|
||||
value: null, // optional
|
||||
max: null // optional
|
||||
value: 0, // optional
|
||||
max: 0 // optional
|
||||
});
|
||||
|
||||
console.log(result);
|
||||
|
||||
Reference in New Issue
Block a user