I can't seem to get data from my taffyDB. It has to be bad syntax but I don't know where. My Javascript looks like this:
// init db
var procTech = TAFFY();
//..... other code in the middle
procTech().remove();
var x = 0;
$(".sxRow select[id^='KRCtech_']").each(function() {
var techName = $(this).val();
x++;
var xStr = x.toString();
clog(xStr + " " + techName);
procTech.insert({"count":xStr,"tech":techName });
});
var ret = eval(procTech().select("count","tech"));
clog(ret.length);
for (j = 0; j <= ret.length - 1; j++) {
clog("read back: " + [j][0] + "," + [j][1]);
}
// wrapper for console.log
function clog(s) {
window.console && console.log(s);
return;
}
console says:
1 tonya
2 shawn
2
read back: 0,undefined
read back: 1,undefined
so I know that
- my initial values are good; i.e. they have value
- Taffy sees 2 records, which is correct
It's just when I try and retrieve them, they are garbage.
What am I doing wrong?