Sails.js Sails水线模型-属性解析为postgres bigint列的字符串

Sails.js Sails水线模型-属性解析为postgres bigint列的字符串,sails.js,waterline,sails-postgresql,Sails.js,Waterline,Sails Postgresql,我在PostgreSQL的吃水线旁使用帆。我对模型属性定义中的defaultsTo参数有问题 以下是我的模型定义的一部分: module.exports = { tableName: 'table', attributes: { [...] reach: { type: 'number', defaultsTo: 0, } [...] } } 使用Model.create()时,我收到以下控制台警告: Warning: Af

我在PostgreSQL的吃水线旁使用帆。我对模型属性定义中的
defaultsTo
参数有问题

以下是我的模型定义的一部分:

module.exports = {
  tableName: 'table',

  attributes: {
    [...]
    reach: {
      type: 'number',
      defaultsTo: 0,
    }
    [...]
  }
}
使用
Model.create()
时,我收到以下控制台警告:

Warning: After transforming columnNames back to attribute names for model `model`,
 a record in the result has a value with an unexpected data type for property `reach`.
The corresponding attribute declares `type: 'number'` but instead
of that, the actual value is:
` ` `
'0'
` ` ` 
我有一堆
number
type属性,因此在我的控制台中会出现很多警告

在这一点上,我认为这是一个吃水线问题,但你有一个解决办法,以避免这一警告


编辑

我的警告只出现在Postgres的“BIGINT”栏中
我开始明白JS无法将postgres BIGINT作为数字处理,因此必须将其转换为字符串。

我找到了一种避免警告的方法: 以不同的方式设置属性:

attributes: {
  [...]
  reach: {
    type: 'ref',
    columnType: 'bigint',
    isNumber: true,
    defaultsTo: 0
  },
  [...]
}

我也有这个问题!谢谢你,我要试试这个!!我的问题是我需要创建时间字段,比如
createdAt
updatedAt
字段,这是您找到的实现方法吗?我尝试了这个方法,但是数字仍然以字符串形式返回:(