Update Query In nested Document

Following is the json format we have right now

[
{
“detail”: {
“about”: “Ha Ha Ha Andhera kayam hm rahe.”,
“approved_point”: “0”,
“devices”: [
“{“device_id”:“test” , “fcm_id”:“test” }”,
“{“device_id”:“wow” , “fcm_id”:“test” }”
],
“email”: "mustanish.altamash@gmail.com",
“email_verify”: “1”,
“facebook_access_token”: “EAAT5Fi7StxsBAOEdiBZBpyrNrbVVeNzboa6SmKpUcH7QaNzOiOcrmABatjSFKImOXlZBvE4j8ZBAZB14qdwct91IuLJvniIByGhkx6ChA7BTfu2sDZCL3kIuC7w0anV0jXdRmkpDZAPsA7tihA0eZAoA66zfCiUV7MZD”,
“facebook_id”: “10207936631359310”,
“gender”: “male”,
“home”: [
“Triveni Commercial Complex Sheikh Sarai Phase 1 New Delhi Delhi”,
“28.53640100”,
“77.22342200”,
“SOSM9C”
],
“last_visited”: “12345”,
“location”: “New Delhi”,
“mobile”: “9582058100”,
“mobile_verify”: “”,
“name”: “Mustanish Altamash”,
“office”: [
“Mapmyindia Head Office New Delhi Okhla Industrial Estate Phase 3 New Delhi Delhi”,
“28.54951300”,
“77.26780900”,
“MMI000”
],
“password”: “523198ad0b9364bcb44f6154a6d5b53d”,
“permissions”: [
“115”,
“103”,
“101”,
“200”,
“112”
],
“registered_timestamp”: “2016-06-10 18:55:52”,
“social_id”: “112”,
“twitter_access_token”: “198879865-fFJVt1arvSlz9vlGLkHDg6ZoRqKUoovsQJS9zNPf@5EgJmGLlE0SvSXVNUjxlP5Zq71qw9IyyFhFeaKC6IoTSJ”,
“twitter_id”: “198879865”,
“unapproved_point”: “1050”,
“user_id”: “305722704”,
“user_name”: “mustanish123”,
“user_photo”: “mustanish123.jpg”
}
}
]

Now From the above json, what I want to achieve is that I want to update last_visited,permission and device field in one query. I am able to update them individually.

Use multiple set clause as described in https://developer.couchbase.com/documentation/server/current/n1ql/n1ql-language-reference/update.html

Example:
UPDAET default SET a = 123, b = “xyz”, c = true WHERE d = 120 AND …;

Post the query that is not working. or show the expected output of the fields after update.

Take a look at the Sub-Document API.

You’ll need to determine the paths to all fields you want to update - a quick look suggests something like:

[0].detail.last_visited
[0].detail.permissions
[0].detail.devices