Update document type

Suppose i have document type :slight_smile:
“name”:“createor arch”,

now i need to change the document type ,for example after updating my document will be
“name”:“createor arch”,
How to run this update operation

UPDATE default AS d
SET d.type = "hall_archive"
WHERE d.type = "archive";

SELECT d AS hall_archive FROM default AS d
WHERE d.type = "hall_archive";

It works perfectly fine…But as we know that in couchbase document key is immutable.So how can we insert as new key and delete old one.

You can use INSERT INTO SELECT and then to insert and delete old one as separate statement.