typicaljoe/taffydb — Issue #8: update is noop when trying to cast values as different type
Author: dschein
Created: 2012-01-13 19:36:21+00:00
State: open

I wanted to change a column of strings ["1.2", "2.3",...] to floats so I used:

db().update(function(){ this.floatish = parseFloat(this.floatish); return this; });

But this fails, seemingly because the following check should use strict not equals (https://github.com/typicaljoe/taffydb/blob/master/taffy.js#L1084):

- if (TAFFY.isUndefined(or[i]) || or[i] != v) {
+ if (TAFFY.isUndefined(or[i]) || or[i] !== v) {

Workaround is to put the new value a new column (or patch of course).

Thanks for your work.

Peace,
David S.