Back

[SOLVED] Rest API get collection api with mutile query's not working

  • 0
  • Databases
  • Web
sehjad ansari
21 Jun, 2023, 13:08

I have crated attributes index on cloud and then try to use a this query "?queries[]=limit(100)&queries[]=equal("core_slug", ["handynation"])" but this is not working any thing wrong here

Thanks

TL;DR
Title: [SOLVED] Rest API get collection api with multiple queries not working Solution: The issue with the REST API was resolved. The user had mistakenly used the `equal` query instead of a full-text search. They provided a PHP example code that can be used to make the API call successfully. They also suggested checking with Node.js to verify if it works.
Binyamin
21 Jun, 2023, 13:10

Can you check with Node.js for example?

Binyamin
21 Jun, 2023, 13:10

To see that it work correctly

Bouahaza
21 Jun, 2023, 13:17

Explain what not working, cause I test it and it's ok

Binyamin
21 Jun, 2023, 13:18

PHP is also good example try this

TypeScript
<?php

use Appwrite\Client;
use Appwrite\Query;
use Appwrite\Services\Databases;

$client = new Client();

$client
    ->setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
    ->setProject('5df5acd0d48c2') // Your project ID
    ->setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
;

$databases = new Databases($client);

$result = $databases->listDocuments('[DATABASE_ID]', '[COLLECTION_ID]', [
Query::equal('core_slug','handynation'),
]);
Binyamin
21 Jun, 2023, 13:18

For this example you'll need an API key.

Bouahaza
21 Jun, 2023, 13:19

FYI equal !== full text search

sehjad ansari
22 Jun, 2023, 11:34

yes it's working now

Guille
22 Jun, 2023, 13:33

[SOLVED] Rest API get collection api with mutile query's not working

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more