Added support for 'boolean' type.#87
Added support for 'boolean' type.#87mistic100 merged 1 commit intomistic100:masterfrom cmrbck:master
Conversation
|
I don't see the gain over an int. people will always use a radios group or a selectbox for yes/no values so possible values are already filtered and what if I want yes/no or 1/0 instead of true/false ? (like PHP filter_var() accept) also this !!(value.trim().toLowerCase() === "true")is useless, same as value.trim().toLowerCase() === "true"(and is jshint compliant) |
|
The use case I see this for is when you want to compare against a field of type boolean that ONLY contains true or false values. Currently there doesn't seem to be a way to do this (at least, I can't figure out how). For example, I want to do a query and return only the records that contain the field 'foo' with a value of true. Using int for this won't work, for example: Using string for this also doesn't work: |
|
ok I though Mongo accepts ints as bools but you have a problem in the SQL plugin, without prepared statement the boolean is concatenated to the string, resulting in "true"/"false" and not "1"/"0" (it might work on MySQL but certainly not on others DBMS) and with prepared statement I am not sure what will happen (depends on engine ?) I won't merge until you or I find a nice solution to also accept (and convert) at least 0 and 1 as raw values |
|
It would be nice if you could squash your commits when done ( |
Added support for 'boolean' type.
|
Thanks! |
No description provided.