I ran this n1ql query on my dataset:
update arc set box.qty = 25 where type = 'product' and sku like 'UGO-CASE01-RHDL-%';
Here are 2 example product documents for reference:
Product with box.qty already set:
{
"arc": {
"box": {
"qty": 25
},
"cbId": "ugobags-uos-product-UGO-CASE01-RHDL-BK-LG",
"created": "2017-01-13T00:23:52+00:00",
"for": "CASE01",
"inventory": {
"DWH": "",
"LAO": "",
"LAW": ""
},
"manufacturer": "UGOBAGS",
"modified": "2017-01-25T21:08:08+00:00",
"name": "Black Large Retractable Handle",
"options": {
"color": "BK",
"size": "LG"
},
"sku": "UGO-CASE01-RHDL-BK-LG",
"type": "product"
}
}
Product w/o box.qty set:
{
"arc": {
"cbId": "ugobags-uos-product-UGO-CASE01-RHDL-BK-MD",
"created": "2017-01-13T00:23:52+00:00",
"for": "CASE01",
"manufacturer": "UGOBAGS",
"modified": "2017-01-13T00:23:52+00:00",
"name": "Black Medium Retractable Handle",
"options": {
"color": "BK",
"size": "MD"
},
"sku": "UGO-CASE01-RHDL-BK-MD",
"type": "product"
}
}
Here is my result from the update statement:
{
"results": [],
"metrics": {
"elapsedTime": "40.286758ms",
"executionTime": "40.240108ms",
"resultCount": 0,
"resultSize": 0,
"mutationCount": 30
}
}
If a run a select statement using the same criteria as in the update, I get 30 documents returned. So the mutationCount is correct on the one hand.
On the other hand, my records were actually NOT updated at all. In other words, the update didn’t even work and the documents without a box.qty value still don’t have one. Yet mutationCount tells me 30 records were updated.
What am I missing? And what did the update query actually do?