水线未能兑现模型types
我有一个问题,我的模型是用boolean
types的属性定义的,但是在某个时候它被解释为一个string。
例如,看起来像这样的模型:
{ attributes: { id: 'string' boolean_thing: {type: 'boolean', columnName: 'BooleanThing'}, } }
当提供这样的请求时:
/api/foo?boolean_thing=false
将导致传递给适配器的标准如下所示:
{ where: { BooleanThing: 'false' }, limit: 30, skip: 0 }
我目前正在运行sails@0.10.0-rc8。 有谁知道这是否是一个错误或configuration错误的问题?
也许这个问题: https : //github.com/balderdashy/sails/issues/1818 ?
你可以做这个修复:
var bol = (req.params("boolean_thing") == "true"); mymodel.find().where({BooleanThing: bol}).exec(...