Below is the response from my spatial view query in Couchbase by providing bounding box parameters:
{
"rows":[
{
"geometry":{
"type":"Point",
"coordinates":[
-71.10364,
42.381411
]
},
"value":{
"location":{
"type":"Point",
"coordinates":[
-71.10364,
42.381411
]
},
"name":"test",
"visibility":"public",
},
"id":"test",
"key":[
[
-71.10364,
-71.10364
],
[
42.381411,
42.381411
]
]
}
]
}
and here is my spatial view query:-
function (doc, meta) {
if (doc.type == "folder" && doc.location && doc.location.type) {
if(doc.location.type=='Point'){
var visibility = doc.enabled === true ? 'public' : 'private';
emit(doc.location, {
name:doc.name,
folder_id:doc.folder_id,
location: doc.location,
visibility:visibility
});
}
}
}
but the JSON response contains unwanted data, so i am wondering how can i remove geometry and key parameter from json response.
Also query returns first 10 records, is there any way so i can set limit and skip parameters so query return all data instead first 10.