I am trying to update a subdoc within an array using the subdoc arrayappend api.
THe doc is below:
{
"id": "100176",
"name": "${__RandomString(20,abcdefghijklmnopqrstuvwxyz,)}",
"notificationEnrollment": {
"issuer": "001",
"domain": "",
"type": "ENCRYPTEDACCOUNT",
"id": "0000255BAIHSDCY",
"apps": {
"app": {
"id": "com.americanexpress.mobile.wallet.carbon.notifications.messages",
"applicationGroup": "INTERNAL__10",
"enrollmentInfoList": [
{
"appVersion": "1.0",
"status": "ACTIVE",
"type": "Push",
"value": true,
"deviceInfo": {
"deviceId": "17BBE19B241C219C3FE766FAE1887CE2",
"deviceToken": "0838273194687468409056870471453029636922734387856368468017913851",
"deviceOS": "deviceOS",
"osVersion": "OSVersion",
"deviceType": "deviceType",
"deviceModel": "deviceModel"
},
"features": [
{
"featureUserIdentifier": {
"issuer": "001",
"domain": "CARD",
"type": "ENCRYPTEDACCOUNT",
"id": "BAIHSDCY0000255"
},
"featureInfoList": [
{
"featureName": "PAYMENT_RECEIVED_ALERT",
"featurePreferenceValue": true,
"attributes": [
{
"key": "daysBeforeDue",
"value": "8"
}
]
},
{
"featureName": "PAYMENT_REMINDER_ALERT",
"featurePreferenceValue": true,
"attributes": [
{
"key": "daysBeforeDue",
"value": "8"
}
]
},
{
"featureName": "STMT_NOTIFICATION_ALERT",
"featurePreferenceValue": true,
"attributes": [
{
"key": "daysBeforeDue",
"value": "8"
}
]
},
{
"featureName": "OFFERS",
"featurePreferenceValue": true,
"attributes": [
{
"key": "daysBeforeDue",
"value": "8"
}
]
},
{
"featureName": "GOLDEN_GOOSE_ALERT",
"featurePreferenceValue": true,
"attributes": [
{
"key": "daysBeforeDue",
"value": "8"
}
]
}
]
}
],
"insertTS": 1503530927066
}
]
}
},
"insertTS": 1503530927070
}
}
I call the below Couchbase API
bucket.mutateIn(contentWrapper.getContent())
.arrayAppend(path, feature).execute();
The path is "notificationEnrollment.apps.app.enrollmentInfoList.0.features.0.featureInfoList"
The error response I get is below :
com.couchbase.client.java.error.subdoc.MultiMutationException: Multiple mutation could not be applied. First problematic failure at 0 with status SUBDOC_PATH_MISMATCH
There seems to be a problem updating a subdoc that resides within array(s). If I change the path to "notificationEnrollment.apps.app.enrollmentInfoList"
the arrayappend works fine.