Back

[SOLVED] Query limit ignored

  • 0
  • Databases
gresakg
21 Jul, 2023, 07:05

I am doing a listDocumments on a collection in the database, with a few queries, but the limit gets ignored regardless to what I write in the limit query. Whatever I do I always get back 25 results

TypeScript
const promise = db.listDocuments( schema.dbid, schema.zapisi, [
        Query.select(
            [ /* ... bunch of fields ... */ ]),
        Query.equal('isDeleted', false),
        Query.greaterThanEqual('zacetekKlica',period.value[0].toISOString()),
        Query.lessThanEqual('zacetekKlica', period.value[1].toISOString(),
        Query.limit(10))
    ])

Am I doing something wrong or is it a bug?

TL;DR
Title: [SOLVED] Bug causing query limit to be ignored Description: The user is experiencing a bug where the query limit is being ignored in their code. They have tried various approaches to set the limit but still receive 25 results. The user is unsure if they are making a mistake or if it is a bug. Solution: After analyzing the code snippet provided, it seems that there is a missing closing parenthesis in the `Query.lessThanEqual` line. The correct code should be: ```javascript const promise = db.listDocuments(schema.dbid, schema.zapisi, [ Query.select([ /* ... bunch
gresakg
21 Jul, 2023, 16:39

There's a bug in the code 😅 🤣 You can try to find it. It only took me about an hour 🤪

Drake
21 Jul, 2023, 19:25

[SOLVED] Query limit ignored

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