-
Notifications
You must be signed in to change notification settings - Fork 20
Expand file tree
/
Copy pathupdateFloatAttribute.cpp
More file actions
26 lines (22 loc) · 868 Bytes
/
updateFloatAttribute.cpp
File metadata and controls
26 lines (22 loc) · 868 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
#include "Appwrite.hpp"
#include <iostream>
int main() {
std::string projectId = "66fbb5a100070a3a1d19";
std::string apiKey = "";
std::string databaseId = "database123";
std::string collectionId = "test1234";
std::string attributeId = "Float123";
bool required = true;
double min = 5.0;
double max = 100.0;
std::string defaultValue = "";
std::string new_key = "UpdatedFloat123";
Appwrite appwrite(projectId, apiKey);
try {
std::string response = appwrite.getDatabases().updateFloatAttribute(databaseId, collectionId, attributeId, required, min, max, defaultValue, new_key);
std::cout << "Float attribute updated successfully! \nResponse: " << response << std::endl;
} catch (const AppwriteException& ex) {
std::cerr << "Exception: " << ex.what() << std::endl;
}
return 0;
}