Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions dapr/clients/grpc/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -475,11 +475,11 @@ def query_state(
query = '''
{
"filter": {
"EQ": { "value.state": "CA" }
"EQ": { "state": "CA" }
},
"sort": [
{
"key": "value.person.id",
"key": "person.id",
"order": "DESC"
}
]
Expand Down
4 changes: 2 additions & 2 deletions daprdocs/content/en/python-sdk-docs/python-client.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,11 @@ with DaprClient() as d:
query = '''
{
"filter": {
"EQ": { "value.state": "CA" }
"EQ": { "state": "CA" }
},
"sort": [
{
"key": "value.person.id",
"key": "person.id",
"order": "DESC"
}
]
Expand Down
24 changes: 12 additions & 12 deletions examples/state_store_query/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,13 @@ Now run the app
<!-- STEP
name: Run get query example
expected_stdout_lines:
- '== APP == 1 {"city": "Seattle", "person": {"id": {"$numberDouble": "1036.0"}, "org": "Dev Ops"}, "state": "WA"}'
- '== APP == 4 {"city": "Spokane", "person": {"id": {"$numberDouble": "1042.0"}, "org": "Dev Ops"}, "state": "WA"}'
- '== APP == 10 {"city": "New York", "person": {"id": {"$numberDouble": "1054.0"}, "org": "Dev Ops"}, "state": "NY"}'
- '== APP == 1 {"city": "Seattle", "person": {"id": 1036.0, "org": "Dev Ops"}, "state": "WA"}'
- '== APP == 4 {"city": "Spokane", "person": {"id": 1042.0, "org": "Dev Ops"}, "state": "WA"}'
- '== APP == 10 {"city": "New York", "person": {"id": 1054.0, "org": "Dev Ops"}, "state": "NY"}'
- '== APP == Token: 3'
- '== APP == 9 {"city": "San Diego", "person": {"id": {"$numberDouble": "1002.0"}, "org": "Finance"}, "state": "CA"}'
- '== APP == 7 {"city": "San Francisco", "person": {"id": {"$numberDouble": "1015.0"}, "org": "Dev Ops"}, "state": "CA"}'
- '== APP == 3 {"city": "Sacramento", "person": {"id": {"$numberDouble": "1071.0"}, "org": "Finance"}, "state": "CA"}'
- '== APP == 9 {"city": "San Diego", "person": {"id": 1002.0, "org": "Finance"}, "state": "CA"}'
- '== APP == 7 {"city": "San Francisco", "person": {"id": 1015.0, "org": "Dev Ops"}, "state": "CA"}'
- '== APP == 3 {"city": "Sacramento", "person": {"id": 1071.0, "org": "Finance"}, "state": "CA"}'
- '== APP == Token: 6'
timeout_seconds: 5
-->
Expand All @@ -74,13 +74,13 @@ dapr run --app-id queryexample --components-path components/ -- python3 state_st

You should be able to see the following output:
```
== APP == 1 {"city": "Seattle", "person": {"id": {"$numberDouble": "1036.0"}, "org": "Dev Ops"}, "state": "WA"}
== APP == 4 {"city": "Spokane", "person": {"id": {"$numberDouble": "1042.0"}, "org": "Dev Ops"}, "state": "WA"}
== APP == 10 {"city": "New York", "person": {"id": {"$numberDouble": "1054.0"}, "org": "Dev Ops"}, "state": "NY"}
== APP == 1 {"city": "Seattle", "person": {"id": 1036.0, "org": "Dev Ops"}, "state": "WA"}
== APP == 4 {"city": "Spokane", "person": {"id": 1042.0, "org": "Dev Ops"}, "state": "WA"}
== APP == 10 {"city": "New York", "person": {"id": 1054.0, "org": "Dev Ops"}, "state": "NY"}
== APP == Token: 3
== APP == 9 {"city": "San Diego", "person": {"id": {"$numberDouble": "1002.0"}, "org": "Finance"}, "state": "CA"}
== APP == 7 {"city": "San Francisco", "person": {"id": {"$numberDouble": "1015.0"}, "org": "Dev Ops"}, "state": "CA"}
== APP == 3 {"city": "Sacramento", "person": {"id": {"$numberDouble": "1071.0"}, "org": "Finance"}, "state": "CA"}
== APP == 9 {"city": "San Diego", "person": {"id": 1002.0, "org": "Finance"}, "state": "CA"}
== APP == 7 {"city": "San Francisco", "person": {"id": 1015.0, "org": "Dev Ops"}, "state": "CA"}
== APP == 3 {"city": "Sacramento", "person": {"id": 1071.0, "org": "Finance"}, "state": "CA"}
== APP == Token: 6
```

Expand Down
10 changes: 5 additions & 5 deletions examples/state_store_query/query-token.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,27 @@
"filter": {
"OR": [
{
"EQ": { "value.person.org": "Dev Ops" }
"EQ": { "person.org": "Dev Ops" }
},
{
"AND": [
{
"EQ": { "value.person.org": "Finance" }
"EQ": { "person.org": "Finance" }
},
{
"IN": { "value.state": [ "CA", "WA" ] }
"IN": { "state": [ "CA", "WA" ] }
}
]
}
]
},
"sort": [
{
"key": "value.state",
"key": "state",
"order": "DESC"
},
{
"key": "value.person.id"
"key": "person.id"
}
],
"page": {
Expand Down
10 changes: 5 additions & 5 deletions examples/state_store_query/query.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,27 @@
"filter": {
"OR": [
{
"EQ": { "value.person.org": "Dev Ops" }
"EQ": { "person.org": "Dev Ops" }
},
{
"AND": [
{
"EQ": { "value.person.org": "Finance" }
"EQ": { "person.org": "Finance" }
},
{
"IN": { "value.state": [ "CA", "WA" ] }
"IN": { "state": [ "CA", "WA" ] }
}
]
}
]
},
"sort": [
{
"key": "value.state",
"key": "state",
"order": "DESC"
},
{
"key": "value.person.id"
"key": "person.id"
}
],
"page": {
Expand Down