模型描述中 "enum" 和 "in" 之间的区别

difference between "enum" and "in" in model description

这两个模型定义有区别吗?它们似乎都有效,但我在文档中找不到任何内容。

module.exports = {
    schema: true,

    attributes: {
         state: {
           type: 'string',
           enum: [
               'requested',
               'rejected',
               'accepted'
            ]
          }, 
    }
}

还有这个:

module.exports = {
    schema: true,

    attributes: {
         state: {
           type: 'string',
           in: [
               'requested',
               'rejected',
               'accepted'
            ]
          }, 
    }
}

我看到 particlebanana 推荐有人在这里使用 "in" sails-mysql schema datatypes,但是枚举似乎也一样?

应该是一样的,根据这个参考Waterline Docs

还有这个source code

// use the Anchor `in` method for enums
  if(prop === 'enum') {
    self.validations[attr]['in'] = attrs[attr][prop];
    return;
  }