Implement CountAsync<TItem>
See original GitHub issueI would like to request a count of records for a given filter criteria/query. For example:
SELECT VALUE COUNT(1) FROM c WHERE c....
When querying CosmosDb directly, this returns a response as follows:
[
27
]
(In the example above, there are 27 records)
Using the repository, this doesn’t seem possible. Is there a way to use the existing repository to get the above result back, or would a new method be required?
Since all POCOs must derive from IItem, I have tried to create a POCO for the anonymous array response type above but have faced some challenges (with deserialization, etc). I don’t this its possible (but could be wrong, only spent a few minutes experimenting).
Issue Analytics
- State:
- Created 2 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
No results found
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Yeah certainly can be done, I have been thinking about an
ExistsAsync
also.Hi @CarloGarcia would you fancy having ago at implementing this? Feel free to open a draft PR with your idea if you want some feedback 👍