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.

Add metadata to save field

See original GitHub issue

Expected Behavior

Should be able to use save with metadata

Actual Behavior

We only allow key and value so cannot do this

Steps to Reproduce the Problem

    await daprClient.state.save(Config?.dapr?.components?.state?.cosmos?.name, [
      {
        key: "test",
        value: { hello: "world", partitionID: 2083 },
        metadata: {
          partitionKey: "partitionID"
        }
      }
    ])

Will result in

== APP == Error: {"errorCode":"ERR_STATE_SAVE","message":"failed saving state in state store state-azure-cosmosdb: BadRequest, Message: {\"Errors\":[\"PartitionKey extracted from document doesn't match the one specified in the header. Learn more: https:\\/\\/aka.ms\\/CosmosDB\\/sql\\/errors\\/wrong-pk-value\"]}\r\nActivityId

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
XavierGeerinckcommented, Jun 18, 2022

Tracking the PartitionKey not working in https://github.com/dapr/components-contrib/issues/1794

For the JS SDK we should implement the metadata part (see fetch example in the issue above)

0reactions
XavierGeerinckcommented, Jun 30, 2022
Read more comments on GitHub >

github_iconTop Results From Across the Web

Adding metadata to a data field - IBM
Select the metadata that you want to add to the data field and click OK. Click Save.
Read more >
Creating Custom Metadata Fields
Click Save Field to save the changes. Click Save and add another to save the field and begin creating another field. Custom fields...
Read more >
Create and Manage Custom Metadata Types Unit - Trailhead
Click Next and then click Save. Form showing the custom fields of a custom metadata type. By itself, a custom metadata type isn't...
Read more >
How do I add custom metadata fields to my sequence?
To add a custom metadata field that does not already exist in Geneious, click the Info ... Click Save to record the change...
Read more >
Creating and deleting metadata fields - ResourceSpace
To create a new metadata field navigate to Admin > System > Manage Metadata Fields. metadata_fields_admin. Enter the name of your new metadata...
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