I am using Couchbase Server Version: 4.5.0-2601 Enterprise Edition (build-2601) with Couchbase SyncGateway 1.2.0.
and the following N1QL works fine:
select meta().id,_sync.rev as rev,object_remove(mydb,"_sync").* from mydb USE KEYS ["doc1","doc2"];
PS: I want to get all doc’s id and rev,without _sync
property.
and when I create a PREPARE statement with following command:
curl -v http://127.0.0.1:8093/query/service --data-urlencode 'statement=PREPARE getDocByID FROM SELECT meta().id,_sync.rev as rev,object_remove(mydb,"_sync").* FROM mydb a USE KEYS $keys;'
it return success
.
but when I query data with:
curl -v http://127.0.0.1:8093/query/service -d 'prepared="getDocByID"&$keys=["doc1","doc2"]'
it only return id
and rev
field like this:
{
"requestID": "1a85e350-443e-4d89-b459-9a066a486e0c",
"signature": {
"*": "*",
"id": "json",
"rev": "json"
},
"results": [
{
"id": "doc1",
"rev": "1-a37966aab4cadf74c8d020948fff8a79"
},
{
"id": "doc2",
"rev": "2-0718fa8ffec7115c53c794124b74059f"
}
],
"status": "success",
"metrics": {
"elapsedTime": "1.219235ms",
"executionTime": "1.137076ms",
"resultCount": 2,
"resultSize": 226
}
}