I am using bulk_get(/{db}/_bulk_get) API from Couchbase to get bulk documents, below is my code
def getBulkJsonDoc(doc_ids):
"""
@purpose: gets a bulk docs from couchbase
"""
r = requests.post(base_url + '_all_docs', json.dumps({'keys' : doc_ids})).json()
body = {'docs' : []}
for row in r['rows']:
if 'error' in row:
continue #Doc not found
doc = {}
doc['rev'] = row['value']['rev']
doc['id'] = row['id']
body['docs'].append(doc)
r = requests.post(base_url + '_bulk_get', json.dumps(body))
docs = []
for l in r.content.split('\n'):
try:
j = json.loads(l)
docs.append(j)
except Exception as e:
pass
return docs
But it seems like Couchbase doesn't returning updated result, when i try to retrieve single document it return updated results. So is there any way to force update the result?