Still not working. I think Fields order is wrong. At the end of the select() function I write this:
a = [] for f in fields: a.append(f.type) return dict(rows=rows, fields=a, colnames=colnames) and I got this: colnames: city age _id name fields: id text integer string rows: Toronto 66L 24652490551171733682233802752L John