相关疑难解决方法(0)

在Sailsjs中是否有可能构建更复杂的模型

我想在我的模型中有数组或集合,这是否可以使用waterline(mongoDB)?周围有什么替代品吗?

例:

{
   name: Bundle,
   col1 : {
      name : anOtherModel,
      subCol: {
         text: aString,
         ...
      }
   },
   col2 : {
      name : anOtherModel,
      subCol: {
         text: aString,
         ...
      }
   }
}
Run Code Online (Sandbox Code Playgroud)

至:

module.exports = {

    attributes : {

        name : {
            type : 'STRING',
            required : true
        },
        basicModules: {
            type : 'ARRAY', // or 'COLLECTION'
            required : false
        }
    }

};
Run Code Online (Sandbox Code Playgroud)

sails.js waterline

10
推荐指数
1
解决办法
2830
查看次数

标签 统计

sails.js ×1

waterline ×1