Open makaishi opened 8 years ago
@makaishi I've copied your code suggestion from the community. I think you caught a typo in the code. I will double check and update this issue when the issue is resolved. In the mean time you can test this by copying the R Code from the console ouput and paste it into an R Transform node. this will let you tweak the code on the fly.
In the source code, queryView part is as follow:
#########################
} else if (operation == “queryView”) {
# executing a view
cdb$design <- "%%design_doc%%"
cdb$view <- "%%view%%"
cdb$queryParams <- "%%query_params%%"
cdb <- cdbGetView(cdb)
modelerData <- rbind.fill(
llply(cdb$res[[3]], function(x) data.frame(id=x$id, key=x$key, as.vector(flattenList(x$value))))
)
}
###################
But in R4CouchDB document, a keyword of "query_params" is not "queryParams" but "queryParam". Is this the reason? Or can I see cdb$error after cdbGetView call error occurred.
https://cran.r-project.org/web/packages/R4CouchDB/R4CouchDB.pdf
@makaishi can you check the view setting in cloudant. To disable reduce
then take a try.
for result of curl -X GET "https://$USERNAME:$PASSWORD@$USERNAME-bluemix.cloudant.com/sensordata/_design/view/_view/filter"
should like this.
{"total_rows":2,"offset":0,"rows":[ {"id":"99e10f3d464c997b66c0b6f098fe1815","key":"99e10f3d464c997b66c0b6f098fe1815","value":1}, {"id":"cbad86d56114fb55fb69be34744db6fc","key":"cbad86d56114fb55fb69be34744db6fc","value":1} ]}
I tried cloudant extension and it worked well when using "Retrieve the hole database" operation. But it cannot work when using "Query a view" operation. My parameter settings is as follows:
I cat get data when I call following curl command. curl -X GET "https://$USERNAME:$PASSWORD@$USERNAME-bluemix.cloudant.com/sensordata/_design/view/_view/filter"