ql io script :
var script = 'u = require("./myUDF.js");\
create table myoffers on select get from "https://api.sqoot.com/v1/offers?affiliate_token={^token}&location={mylocation}&order={^orders}&page={^page}&per_page={^psize}"\
using headers accept = "/" \
using defaults token = "xxxxx", orders = "score", page = "1", psize = "3" \
resultset "offers" ' \
select offer.title as mytitle, u.getGoogleID(10) as loc from myoffers where mylocation = 'sanfransico'
my udf function :
var util = require('util');
exports.getGoogleID = function (id) {
return this.next(null, id+10);
}
WHAT I AM MISSING HERE ?... my result is
{ title: 'The best of Heering at 50%.', loc: undefined } // the loc value should be 20
SOMEHOW I AM UNABLE TO ENTER IN MY UDF FUNCTION...... what is the possible reason for that ?
Does this udf functionality implementing in 'select' clause as it was working in my where clause ??select e.ItemID as id, e.Title as title, e.ViewItemURLForNaturalSearch as url, g.geometry.location as latlng from details as e, google.geocode as g where e.itemId in (select itemId from finditems where keywords = "iPad") and g.address = e.Location