Back

1.1.2 Index not found: createdBy

  • 0
  • Databases
  • Web
  • Cloud
Nimit Savant
2 Jun, 2023, 14:21

in appwrite cloud 1.1.2 index not found while using Query.equal("createdBy", "random") this should result in a direct query list, "why" is this considering the attribute as index?

TL;DR
The user was initially confused about the documentation stating that indexes are no longer mandatory in version 1.3.0+. However, they found a solution to their issue and confirmed that it is now working. They asked if it is possible to directly query an attribute, but the answer is no. The user then questioned why the attribute is considered an index. The solution is to add an index to the "createdBy" attribute.
Nimit Savant
2 Jun, 2023, 14:21
TypeScript
        const chatSessions = await database.listDocuments(
          databaseId,
          sessionCollectionId,
          [Query.equal('createdBy', userId!!)]
        );
        console.log('Chat Sessions', chatSessions.documents);
Binyamin
2 Jun, 2023, 14:23

Have you added index to createdBy attribute?

Nimit Savant
2 Jun, 2023, 14:23

nope but my question is why :(

Nimit Savant
2 Jun, 2023, 14:23

can't we directly query an attrib?

Nimit Savant
2 Jun, 2023, 14:24
Nimit Savant
2 Jun, 2023, 14:25

yup its working now thanks :)

Nimit Savant
2 Jun, 2023, 14:26

but my question still remains the same, are the docs wrong? Or I'm understanding it in a wrong way...

Binyamin
2 Jun, 2023, 14:29

The docs refereing to version 1.3.0+ in which indexes are no longer mandatory

Nimit Savant
2 Jun, 2023, 14:38

ohhhh

Nimit Savant
2 Jun, 2023, 14:38

thanks

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