node.js - Waterline fails to honor model type -
i'm having issue model defined attribute of type boolean @ point it's beingness interpreted string.
for example, model looks this:
{ attributes: { id: 'string' boolean_thing: {type: 'boolean', columnname: 'booleanthing'}, } } when given request this:
/api/foo?boolean_thing=false will result in where criteria beingness passed adapter looks this:
{ where: { booleanthing: 'false' }, limit: 30, skip: 0 } i'm running sails@0.10.0-rc8. know if bug or misconfiguration issue on part?
maybe problem: https://github.com/balderdashy/sails/issues/1818?
you can fix:
var bol = (req.params("boolean_thing") == "true"); mymodel.find().where({booleanthing: bol}).exec(... node.js sails.js waterline
No comments:
Post a Comment