Hi,
I have an N1QL query to update an array in my document removing an object in an array.
Here is my sample document :
{
“channelTenantId”: “ct1”,
“conversions”: [
{
“eventName”: “abc”,
“goalId”: “1234”,
“totalConversions”: 6
},
{
“eventName”: “def”,
“goalId”: “5678”,
“totalConversions”: 6
}
],
"orgId": "0987",
"type": "sessionsummary",
}
The Update query I am using is the following :
Update test set conversions = ARRAY v for v in conversions when v.goalId!=“1234” END where type=“sessionsummary” and orgId=“0987”
I have around million records for which the query is timing out. I want to apply an index to optimize the performance and get the desired result. I dont know how to proceed. Any help would be appreciated. Thanks