You can insert multiple columns for a single/multiple column family in a single PUT operation. --data
payload contains the key
and CellSet
, CellSet contains base64 encoded value of cf:columnname
and $
contains the base64 encoded value of column value.
For example :
{ "Row":[
{
"key":"d3d3LnNvbWVzaXRlLmNvbQ==",
"Cell":[
{
"column":"QXV0aG9yczp0ZXN0MQ==", // It can be cf1:name
"$":"c29tZURhdGE="
},
{
"column":"QXV0aG9yczp0ZXN0Mg==", // It can be cf2:address
"$":"bW9yZURhdGE="
}
]
}
]
}
The final curl command will look like this:
curl -vi -X PUT \
-H "Accept: text/json" \
-H "Content-Type: text/json" \
-d '{"Row":[{"key":"d3d3LnNvbWVzaXRlLmNvbQ==","Cell":[{"column":"QXV0aG9yczp0ZXN0MQ==","$":"c29tZURhdGE="},{"column":"QXV0aG9yczp0ZXN0Mg==","$":"bW9yZURhdGE="}]}]}' \
"localhost:20550/table/rowkey"