Back

[SOLVED] Index not found - $id, $createdAt, languageIso

  • 0
  • Databases
  • Flutter
  • Cloud
Chandan Gowda
14 Aug, 2023, 02:29

I have attached the code snippet which gives me an error saying index not found in appwrite cloud.

TL;DR
Issue: The user is getting an error saying "Index not found" in their appwrite cloud when running a code snippet. Solution: Try creating one index with both attributes ($id, $createdAt, languageIso). Ensure that all necessary indexes are added in the appwrite cloud.
Chandan Gowda
14 Aug, 2023, 02:30

I have added all the index

Chandan Gowda
14 Aug, 2023, 02:31

This is the error I'm getting

Drake
14 Aug, 2023, 02:33

Can you try creating one index with both those attributes?

Chandan Gowda
14 Aug, 2023, 02:37

Yes it worked. Thanks

Chandan Gowda
14 Aug, 2023, 02:37

Also

Chandan Gowda
14 Aug, 2023, 02:37

I'm using a cloud function for match making

Chandan Gowda
14 Aug, 2023, 02:39

This is my approach:

  1. User A creates a request which will add a document into requests collection
  2. If User B with same language requests, then I am quering the requests collection to get the oldest request by any user which in this case is User A and then deleting both A and B's request
  3. Add a document in active-pairs collection
Chandan Gowda
14 Aug, 2023, 02:39

Will this lead to any inconsistency in production ?

Drake
14 Aug, 2023, 02:41

Ya you could run into a race condition if multiple requests happen at the same time

Chandan Gowda
14 Aug, 2023, 02:42

Okayy. Is there any better approach for the same ?

longline
14 Aug, 2023, 03:03

Certainly, here's a concise version of the considerations for your matchmaking approach:

  • Concurrency: Address potential issues with multiple requests happening at once by using atomic operations provided by your database or cloud platform.
  • Error Handling: Implement robust error handling to manage failures during matchmaking and data updates.
  • Data Integrity: Ensure consistent data by preventing orphaned or incomplete documents in your collections.
  • Scalability: Ensure your approach can handle growing numbers of users and requests without performance issues.
  • Testing and Monitoring: Thoroughly test your approach and set up monitoring to detect anomalies or inconsistencies.
  • Backup and Recovery: Have a plan for data backup and recovery in case of data corruption.
  • Security: Safeguard user data and adhere to data protection regulations.
  • Feedback Loop: Gather user feedback and monitor system performance to make improvements as needed.
  • Consider Alternatives: Explore other methods like using queues for more controlled and scalable matchmaking.

Balancing these considerations will help you maintain a consistent and stable matchmaking system in production.

longline
14 Aug, 2023, 03:03

gpt answer

Drake
14 Aug, 2023, 03:04

[SOLVED] Index not found - $id, $createdAt, languageIso

Drake
14 Aug, 2023, 03:04
Chandan Gowda
14 Aug, 2023, 03:04

Thanks @longline but I want something on appwrite terms.

Chandan Gowda
14 Aug, 2023, 03:05

I have added a new support post. Please look into it @Steven

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