
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
- Offline replication with RXDB
Hey there! Trying out apprwrite with rxdb for an offline focussed application. I cannot seem to find on how to set the permissions on a per document level?
- How to Fetch Item and Include the User/A...
A typical workflow with ORMs is to, for example, fetch an item from the DB and include the user who created it. How would I do that with AppWrite? Is that easil...
- Unable to add permission when creating a...
I am creating a collection from a cloud function using the Appwrite Dart server SDK, and I want to add permissions so it can be accessed by users. I added code ...
