Query.limit() returning inconsistent results - same collection, different document counts
- 0
- Databases
Hi I wonder if someone could help me out with an issue.
For some reason I am finding running identical queries on the same collection with different limits returns completely different documents, even when total document count is well below the limit.
Environment:
- Appwrite version: 1.7.4
- Next.js API routes
- Single collection with ~8 documents
Code: // Query 1 - returns 2 documents that were previously deleted from my database const docs1 = await databases.listDocuments(DB_ID, COLLECTION_ID, [Query.limit(100)]); console.log('Total:', docs1.total, 'Returned:', docs1.documents.length); // Output: Total: 4, Returned: 2, Shows: parks 1,1
// Query 2 - returns 8 documents const docs2 = await databases.listDocuments(DB_ID, COLLECTION_ID, [Query.limit(1000)]); console.log('Total:', docs2.total, 'Returned:', docs2.documents.length); // Output: Total: ?, Returned: 8, Shows: parks 3,278,315,316,25,12,25,25
Expected: Both queries should return the same documents since limit(100) should be sufficient for a collection with <100 docs.
Actual: Different queries return completely different document sets, as if accessing different collections or indexes.
Has anyone seen similar inconsistent query results? Is this a known issue with document visibility/indexing or am I doing something silly?
Recommended threads
- MongoDb Database Breaks integer[] & bigi...
I've got a table with the below column created. When I try to insert the value `[-3408048000]` into it, the dart sdk cloud function call is successful (no error...
- 1.9.6 Console handles all array columns ...
When creating or updating a row in the appwrite 1.9.6 web console, the form treats all list columns as a type string. Even if the column is a list of booleans, ...
- Temporary $permissions hickup?
Hello, today at ~13:50 (CEST/UTC+2) our customers reported they couldn't see any data in our application. We checked and indeed, the application was working, bu...