CartoDB / cartodb-nodejs

Node.js package for easy access to CartoDB's APIs
BSD 4-Clause "Original" or "Old" License
46 stars 34 forks source link

Template does not support multiple values #15

Closed gouldingken closed 11 years ago

gouldingken commented 11 years ago

The tmpl function should support multiple values e.g.

UPDATE {table} SET {field}= {val} WHERE ({id}>=32 AND {id}<=42) OR {id} IN (26, 28, 66)

Currently only the first {id} is replaced.

This may not be the most efficient way, but you could rewrite:

s = s.replace('{'+p+'}', d[p]);

as

s = s.split('{'+p+'}').join(d[p]);