dynamodb借助NP dynamodb或NP vogels,抛出无效的架构内容错误

问题描述

我正在尝试使用节点包dynamodb / vogels创建架构,但是它抛出了无效的架构内容。我使用了以下示例架构

var Account = vogels.define('Account',{
  hashKey : 'email',// add the timestamp attributes (updatedAt,createdAt)
  timestamps : true,schema : {
    email   : Joi.string().email(),name    : Joi.string(),age     : Joi.number(),roles   : vogels.types.stringSet(),settings : {
      nickname      : Joi.string(),acceptedTerms : Joi.boolean().default(false)
    }
  }
});

错误详细信息

Uncaught Error: Invalid schema content: 
node_modules/vogels/node_modules/hoek/lib/index.js:731
Debugger attached.
Waiting for the debugger to disconnect...
c:\my-workspace\dynamoDB\node_modules\vogels\node_modules\hoek\lib\index.js:731
    throw new Error(msgs.join(' ') || 'UnkNown error');
    ^

Error: Invalid schema content: 
    at Object.exports.assert (c:\my-workspace\dynamoDB\node_modules\vogels\node_modules\hoek\lib\index.js:731:11)
    at Object.exports.schema (c:\my-workspace\dynamoDB\node_modules\vogels\node_modules\joi\lib\cast.js:65:10)
    at internals.Object.keys (c:\my-workspace\dynamoDB\node_modules\vogels\node_modules\joi\lib\object.js:269:25)
    at Object.exports.schema (c:\my-workspace\dynamoDB\node_modules\vogels\node_modules\joi\lib\cast.js:46:33)
    at internals.Object.keys (c:\my-workspace\dynamoDB\node_modules\vogels\node_modules\joi\lib\object.js:269:25)
    at Object.exports.schema (c:\my-workspace\dynamoDB\node_modules\vogels\node_modules\joi\lib\cast.js:46:33)
    at internals.Object.keys (c:\my-workspace\dynamoDB\node_modules\vogels\node_modules\joi\lib\object.js:269:25)
    at c:\my-workspace\dynamoDB\node_modules\vogels\lib\schema.js:105:74
    at internals.Object.internals.Any._validateWithOptions (c:\my-workspace\dynamoDB\node_modules\vogels\node_modules\joi\lib\any.js:460:16)
    at module.exports.internals.Any.root.validate (c:\my-workspace\dynamoDB\node_modules\vogels\node_modules\joi\lib\index.js:102:23)
Process exited with code 1

有人遇到过这种情况吗,或者知道如何使用节点页面dynamodb / vogels创建架构吗?

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)