two questions. the Server SDK for NodeJS says that if I want to do a 'verification' i think that means to set a users 'verified' status, the first parameter is a URL?! see sample.
secondly, to update a document i have to know the document id? can't i just query for it? i suppose i can, if the next parameter is an array of Query objects, but it should be documented. UPDATE: nope. i can't.
this should work, but
80 databases.getDocument('cryptfire', 'api', [
81 Query.equal('key', apikey)
82 ]);
it may make more sense in this case
80 databases.updateDocument('cryptfire', 'api', [
81 Query.equal('key', apikey)
82 ]);
because then you can do this, although it probably isn't best practice
try {
databases.getDocument('cryptfire', 'api', [
Query.equal('key', apikey)
]);
// do here what you gotta do
} catch (err) {
res.send('wrong apikey');
}
thx & sry
Please don't put multiple topics in a single post. The point of having support posts is to be able to focus on a single problem.
You can think of get document as get document by id, list documents as find or query for documents, and update document as update document by id. These are the methods available to you so you can use them accordingly. If you want to create some sort of wrapper method does a list documents and then update document, you are free to do so
i understand. i finally got to the OpenAPIv3 spec, so with some focus, i should be able to go my ways with it now. I'm looking to increase the quality and lower the frequency of my questions.
If you're looking for some inspiration for a wrapper around the database methods you could take a look at: https://www.npmjs.com/package/appwrite-database-repository?activeTab=code It doesn't have a updateDocumentBy method yet but that would be a great addition π
Recommended threads
- TablesDB `updateRows` returns `database_...
Hi Appwrite team! Iβm seeing a strange issue with TablesDB bulk row updates on a self-hosted Appwrite instance. **Environment** - Appwrite self-hosted `1.9.0` ...
- Update row sheet not loading
After right clicking a row header and click update, the sidebar fails to load (never-ending skeleton)
- DB Relational Table Request
Hi, I'd like to suggest a rewording of the relationships between tables. - Current wording: storeOperatingDays can contain one storeId ...