How to get the documentID based on its content and update the document with is ID?

I want to update the document given below

  "abv": "7.6",
  "brewery_id": "21st_amendment_brewery_cafe",
  "category": "Irish Ale",
  "description": "Deep toffee color with rich roasty and subtle hop aroma. Chocolate flavors dominate the palate and interact with back-end sweetness.",
  "ibu": "0.1",
  "amenddetails": [],
  "name": "General Pippo's Porter",
  "srm": "0",
  "style": "Porter",
  "type": "beer",
  "upc": "0"

I don’t know the document ID,but I want to update the amenddetails with jsonarray like


by using field abv='7.6’
What is the procedure for doing above?
Shall I go through the N1QL or some other procedure?
Help me in this context.
Thanks in advance.

Do you mean you need to update all documents which have "abv" set to "7.6"?

I want to update only single documentm,In my context abv values are unique

without specifying key, you have to setup secondary index on that property and use N1QL update statement, or make it your key and use subdoc API

In my server iam getting issues while setup secondary index,Can’t I get the document key or id based on its content property?

What version of server are you using? And what kind of issues do you have?

In general you could build a view with your property as a key.

Iam using version 4.5.0-2601 Enterprise Edition (build-2601) and
for secondary index setup

CREATE INDEX id_ix on `Sample`(abv) USING GSI;

Iam getting like this “GSI CreateIndex() - cause: Fails to create index. There is no available index service that can process this request at this time. Index Service can be in bootstrap, recovery, or non-reachable. Please retry the operation at a later time”

You have to add node which will have index service enabled. It is controlled by checkbox on add dialog.

I am getting the exception while inserting document

exception 'CouchbaseException' with message 'LCB_ETIMEDOUT: Client-Side timeout exceeded for operation. Inspect network conditions or increase the timeout' in [CouchbaseNative]/CouchbaseBucket.class.php:132
Stack trace:
#0 [CouchbaseNative]/CouchbaseBucket.class.php(132): _CouchbaseBucket->insert('abc', Array, Array)
#1 /var/www/xxx/service/xxxy.php(350): CouchbaseBucket->insert('abc', Array)


    $bucket = $cluster->openBucket("Sample","abc");

Any solution for this??

Could you enable logging for the extension and show what do they say?