Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LINQ LongCount is not supported by cosmosdb client #738

Closed
FluentGuru opened this issue Aug 27, 2019 · 4 comments
Closed

LINQ LongCount is not supported by cosmosdb client #738

FluentGuru opened this issue Aug 27, 2019 · 4 comments
Labels

Comments

@FluentGuru
Copy link

container.GetItemLinqQueryable().Where(predicate).LongCount() throws a NotSupportedException

@j82w
Copy link
Contributor

j82w commented Aug 27, 2019

Hi @FluentGuru ,

There is currently a PR to add support for CountAsync which is what you should use.

@j82w j82w closed this as completed Aug 27, 2019
@j82w j82w added the LINQ label Aug 27, 2019
@FluentGuru
Copy link
Author

@j82w understood

@thomaslevesque
Copy link
Contributor

I think the exception hit by @FluentGuru was because he didn't set allowSynchronousQueryExecution to true (argument to GetItemLinqQueryable), so synchronous operations are rejected.

But if you do set allowSynchronousQueryExecution to true, you get this instead:

Microsoft.Azure.Cosmos.Linq.DocumentQueryException: 'Method 'LongCount' is not supported.'

Is there a reason why it's not supported? I mean, Int32 should be enough for most scenarios, but when there are more than 2^31 documents, what happens?

@FluentGuru
Copy link
Author

@thomaslevesque I did had the flag set to true and got that exact error you are getting.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants