-
Notifications
You must be signed in to change notification settings - Fork 20
Expand file tree
/
Copy pathupdateStringAttribute.cpp
More file actions
27 lines (23 loc) · 921 Bytes
/
updateStringAttribute.cpp
File metadata and controls
27 lines (23 loc) · 921 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#include "Appwrite.hpp"
#include <iostream>
#include <vector>
int main() {
std::string projectId = "66fbb5a100070a3a1d19";
std::string apiKey = "";
std::string databaseId = "database123";
std::string collectionId = "test1234";
std::string attributeId = "String123";
bool required = true;
std::string defaultValue = "";
std::vector<std::string> elements = {"element13"};
int size = 5;
std::string new_key = "UpdatedString123";
Appwrite appwrite(projectId, apiKey);
try {
std::string response = appwrite.getDatabases().updateStringAttribute(databaseId, collectionId, attributeId, required, defaultValue, elements, size, new_key);
std::cout << "String attribute updated successfully! \nResponse: " << response << std::endl;
} catch (const AppwriteException& ex) {
std::cerr << "Exception: " << ex.what() << std::endl;
}
return 0;
}