I am trying to use Node-Red with Azure Cosmos DB through the node-red-contrib-azure-documentdb - Documents v0.0.3 node. I had this working, but created a new Cosmos container in the Azure Portal. Azure now require all containers to include a partition key. I set the workCenterID as my partition key, but the msg.payload below no longer works in the Documents node. The error message is at the bottom.
Can you help me with the correct syntax for referencing a partition key?
msg.paylaod:
{
"dbname":"{{global.databaseName}}",
"collName":"{{global.tableName}}",
"action":"C",
"doc": {
"databaseName": "{{global.databaseName}}",
"tableName": "{{global.tableName}}",
"workCenter": "{{global.workCenter}}",
"workCenterID": "{{global.workCenterID}}",
"filename": "{{global.filename}}",
"imageURL": "{{global.imageURL}}",
"date": "{{global.date}}",
"timestamp": "{{global.timestamp}}",
}
}
Error Message:
Completed with error {"code":400,"body":"{\"code\":\"BadRequest\",\"message\":\"Message: {\\\"Errors\\\":[\\\"
The partition key supplied in x-ms-partitionkey header has fewer components than defined in the the collection.\\\"]}\\r\\nActivityId: 06690861-f3103f4609, Request URI: /apps/9a97ac3/services/cd2935-4427c0a/partitions/cc395d-6f-61ff/replicas/132011p/, RequestStats: \\r\\nRequestStartTime: 2019-07-09T16:18:29.4513848Z, RequestEndTime: 2019-07-09T16:18:29.4814065Z, Number of regions attempted: 1\\r\\nResponseTime: 2019-07-09T16:18:29.4814065Z, StoreResult: StorePhysicalAddress: rntbd://xxxxx-docdb-1.documents.azure.com:1xxx1/apps/9a95be2d-9ac3/services/cd235-6e800a/partitions/cc39ff-1c1ff/replicas/132071p/, LSN: 2, GlobalCommittedLsn: 2, PartitionKeyRangeId: 0, IsValid: True, StatusCode: 400,...