I need to get the documents as JSON
The view looks like below
function (doc) {
emit(doc._id);
}
The design document looks like below
{
"_id": "_design/rtls",
"_rev": "14-cad60060017c38957f6e4388cb37914b",
"views": {
"rtls": {
"map": "function (doc) {\n emit(doc._id);\n}"
}
},
"language": "javascript"
}
When I get the below data for the below link `http://127.0.0.1:5984/rtls/_design/rtls/_view/rtls?include_docs=true
{"total_rows":4,"offset":0,"rows":[
{"id":"1",
"key":"1",
"value":null,
"doc":{
"_id":"1",
"_rev":"39-6ff9597a13572e831728c2e2631eb425",
"al":[{
"id16":"0x3f1a",
"pos":{"x":17.49,"y":10.97,"z":0.01}}],,
"tl":[],
"Timestamp":272179.0,
"Oid":"apoorva-VirtualBox",
"resultTime":"2021-01-03T23:02:29.059Z"}
}
........
]}
but I need it in the below format
[
{"id":"1",
"key":"1",
"value":null,
"_id":"1",
"_rev":"39",
"al":[{
"id16":"0x3f1a",
"pos":{"x":17.49,"y":10.97,"z":0.01}}],
"tl":[],
"Timestamp":272179.0,
"Oid":"apoorva-VirtualBox",
"resultTime":"2021-01-03T23:02:29.059Z"
}
]
I am very much new to CouchDB. Any input is appreciated. Thanks in advance.