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

rest call metadata #3

Open
mjudeikis opened this issue Jan 13, 2020 · 2 comments
Open

rest call metadata #3

mjudeikis opened this issue Jan 13, 2020 · 2 comments

Comments

@mjudeikis
Copy link
Contributor

I suspect that request calls, currently done with the client does not represent real view:

  1. First call should be to /dbs/{database}/colls/{name}/docs
    with
x-ms-cosmos-is-query-plan-request: True

which will return something like this:

{"partitionedQueryExecutionInfoVersion":2,"queryInfo":{"distinctType":"None","top":null,"offset":null,"limit":null,"orderBy":[],"orderByExpressions":[],"groupByExpressions":[],"groupByAliases":[],"aggregates":["Count"],"groupByAliasToAggregateType":{},"rewrittenQuery":"SELECT VALUE [{\"item\": COUNT(1)}]\nFROM OpenShiftClusters AS doc\nWHERE ((NOT (doc.openShiftCluster.properties.provisioningState IN (\"Succeeded\", \"Failed\"))) AND ((doc.leaseExpires ?? 0) < (GetCurrentTimestamp() / 1000)))","hasSelectValue":true},"queryRanges":[{"min":"","max":"FF","isMinInclusive":true,"isMaxInclusive":false}]}
  1. Call should be to get app parition keys:
    GET to bs/{database}/colls/{name}/pkrange
    where it will return:
{"_rid":"JoEZANUS3lA=","PartitionKeyRanges":[{"_rid":"JoEZANUS3lACAAAAAAAAUA==","id":"0","_etag":"\"00007801-0000-0100-0000-5e0dbc4d0000\"","minInclusive":"","maxExclusive":"FF","ridPrefix":0,"_self":"dbs\/JoEZAA==\/colls\/JoEZANUS3lA=\/pkranges\/JoEZANUS3lACAAAAAAAAUA==\/","throughputFraction":1,"status":"online","parents":[],"_ts":1577958477}],"_count":1}

Where id:0 should be used as x-ms-documentdb-partitionkeyrangeid with the rewrittenQuery from 1st.

@jim-minter, ideas?

@mjudeikis
Copy link
Contributor Author

@mjudeikis
Copy link
Contributor Author

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

No branches or pull requests

1 participant