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
- API key not having access to database
My api key with read and write access to row and tables and DB I not working. In my test the results returned an empty database. This is the second time I am...
- How to bypass the rate limit on the back...
Once a month my app has a ton of usage and I always run into the Too many requests 429 error. I am trying to optimize the queues and jobs to manage that, but a...
- [SOLVED] Appwrite Cloud and FRA cloud se...
Can anyone estimate how long this will take to resolve? I am checking status here https://status.appwrite.online/