question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Issue with where clause when using a client restricted to a partition key

See original GitHub issue

We are experiencing an issue in the following scenario. We have a container with a partitionkey defined. We create users with permissions specific to a single partitionkey. We create a client specific for this user, based on his token. When we query a single item like this: container.ReadItemAsync<T>(itemId, PartitionKey) Everything works as expected, the item is correctly retreived.

However when trying to retrieve a filtered list as such: container.GetItemLinqQueryable<T>(requestOptions: new QueryRequestOptions { PartitionKey = PartitionKey }).Where(query).ToFeedIterator(); var result = new List<T>(); while (iterator.HasMoreResults) result.AddRange(await iterator.ReadNextAsync()); We receive an unauthorized response: 403.

It appears as though the where clause does not respect the QueryRequestOptions. If we remove .Where(query) from the above code, then the issue does not present itself.

Environment summary SDK Version: 3.4.1 .Net Core 2.2 running on Azure App Services

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:32 (14 by maintainers)

github_iconTop GitHub Comments

2reactions
BenLutscommented, Jan 23, 2020

@j82w Thanks. Updated my packages and dit some tests. Seems to work like expected now!

1reaction
j82wcommented, Jan 23, 2020

@BenLuts doing the release now. Should be available within the hour.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to properly select partition keys that match an index
I tried: select distinct office from report where created_by = ? that results in SELECT DISTINCT with WHERE clause only supports restriction by ......
Read more >
A deep look at the CQL WHERE clause
CONTAINS and CONTAINS KEY restrictions can only be used on collections when the query is using a secondary index. Regular column restrictions.
Read more >
Restricting queries using WHERE clauses | CQL for DSE 6.0
Describes restrictions of partition and clustering columns in a WHERE clause. Tables have two types of columns with special roles: the partition key...
Read more >
Best practices for designing and using partition keys ...
Best practices for designing partition keys and using them effectively in DynamoDB.
Read more >
Cassandra Scalability: Filtering and Partition I Instaclustr
Requiring the partition key attributes in the 'where' helps Cassandra to maintain constant result-set retrieval time as the cluster is scaled- ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found