Elfocrash / Cosmonaut

🌐 A supercharged Azure CosmosDB .NET SDK with ORM support
https://cosmonaut.readthedocs.io
MIT License
342 stars 44 forks source link

Document count... #54

Closed leonpotgieter closed 5 years ago

leonpotgieter commented 5 years ago

Hi Nick,

Wondering if you perhaps support a way to count documents in a collection (multi-partition)?

Currently using SELECT VALUE COUNT(1) FROM C in the portal but it doesn't seem to work for collections with multiple partitions... or else it is taking forever to return a value as its been running for over 5m on approx 70k documents?

Thanks Leon

Elfocrash commented 5 years ago

Hey Leon,

Did you try using the .CountAsync() method? It returns the count of the documents in the collection cross partition.

However, as you said, it will take some time but there is no way to get around that.

leonpotgieter commented 5 years ago

Thanks Nick, will give that a go...

Elfocrash commented 5 years ago

Hey @leonpotgieter,

Is this one still an issue or can I close it?