Back

Query does not work with .NET SDK

  • 0
  • Cloud
MrT2010
4 Jul, 2024, 19:49

I have for testing a very easy query and even this is not working:

TypeScript
        var query = new List<string>
        {
            Query.Limit(1)
        };
        var result = await database.ListDocuments(databaseId: databaseId, collectionId: collectionId, queries: query);

result still has 2 documents (my collection has 2 documents) as if I am calling ListDocuments without the query.

I am using: AppWrite Cloud Version 1.5.7 .NET SDK 0.8.3.0

TL;DR
Issue: Query is not being applied when using .NET SDK with AppWrite Cloud Version 1.5.7. Result still shows all documents instead of limited to 1. Solution: The issue might be due to incorrect implementation of the query. Try updating the query format as follows: ```csharp var query = new List<Filter> { new Filter { Limit = 1 } }; var result = await database.ListDocuments(databaseId: databaseId, collectionId: collectionId, filters: query); ``` By adjusting the query format to use `Filter` and specifying the `Limit` property
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