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
"The 'kind' value 'MultiHash' specified in the partition key definition is invalid. Please choose 'Hash' partition type." #1733
Comments
@jacksorjacksor How are you passing the partition key? Can you provide a sample? |
Hi @sajeetharan / @neeraj-sharma2592, thanks for getting back to me.
At this point I don't believe that I am passing in the partition key. Where should I do that as part of DAB's usage?
I've included:
Let me know if any other samples would be appropriate. Rich
type Location @model{
id: ID
TenantId: String
EntityType: String
EntityId: String
Address: String
Buildings: [Building]
}
type Building{
id: ID
Name: String
Levels: [Level]
}
type Level{
id: ID
Name: String
}
{
"$schema": "https://github.com/Azure/data-api-builder/releases/download/v0.8.50/dab.draft.schema.json",
"data-source": {
"database-type": "cosmosdb_nosql",
"connection-string": "AccountEndpoint=[REDACTED]",
"options": {
"database": "RichDb01",
"container": "MRP",
"schema": "schema.gql"
}
},
"runtime": {
"rest": {
"enabled": false,
"path": "/api"
},
"graphql": {
"enabled": true,
"path": "/graphql",
"allow-introspection": true
},
"host": {
"cors": {
"origins": [],
"allow-credentials": false
},
"authentication": {
"provider": "StaticWebApps"
},
"mode": "development"
}
},
"entities": {
"Location": {
"source": "MRP",
"permissions": [
{
"role": "anonymous",
"actions": ["*"]
}
]
}
}
}
Sample item from Cosmos DB
|
@jacksorjacksor Thanks a lot for providing the config and the sample. It's a limitation of DAB for Azure Cosmos DB as we currently use 3.20.0 which does not support hierarchical partitioning. We are in the process of upgrading our SDK within DAB engine and will keep you posted. Another question : were you able to perform query operation with Hierarchical Petitioning enabled? |
@sajeetharan Hi there - huge apologies for the delay. I'm able to run a basic ReadItemAsync() query on the Cosmos DB Emulator (on a container with a hierarchical partition key) through using the .NET SDK v3, but not through the Data Explorer. Has there been any updates on whether DAB is supporting Hierarchical Partitioning? |
Hi @jacksorjacksor, .Net SDK > 3.33.0 Supports Hierarchical Partitioning, as you mentioned that's the reason you see it working with emulator, DAB uses the .Net SDK version 3.20, we investigated supporting Hierarchical partitioning as a feature through DAB with Mutation and Queries, which requires a upgrading the SDK as well as design change. Our tentative ETA to support this is by April 2024. Let me know if you can wait till that. |
@sajeetharan ok great, thanks for the confirmation! |
Hi there!
I'm using DAB to query a CosmosDB NoSQL container with partition keys of:
Example:
The items within this table have been assigned the model of "Location"
I am trying to create an item using the "createLocation" function generated by DAB, with a mutation such as the below:
However I get a 404 message with the error:
The 'kind' value 'MultiHash' specified in the partition key definition is invalid. Please choose 'Hash' partition type.
Please could you let me know how I can use the "createLocation" mutation correctly to create an item within my database?
Thanks!
Rich
The text was updated successfully, but these errors were encountered: