以下に示すように、dynamodb にスキーマがあり、Joi、Vogels、および NodeJS を使用しています。
schema: {
email: Joi.string().email(),
item: Joi.array().items(Joi.object().keys({
a: Vogels.types.uuid(),
b: Joi.string(),
c: Joi.string(),
d: Joi.string().email()
}))
次のデータをテーブルに挿入しようとしています
var Obj = {
email: 'a@b.com',
item: [{
b: 'data',
c: 'some-data',
d: 'b@c.com'
}]
};
以下のnodejsコードを使用して、データをテーブルに挿入しています
Model.create(Obj, function(err, data) {
if (err){
console.log(err);
return cb(err);
} else {
console.log(data);
return cb(null,data);
}
});
次のエラーが表示されます
errors.push(this.createError('object.child', { key, child: child.schema._getLabel(key), reason: result.errors }, localState, options));
TypeError: child.schema._getLabel is not a function
誰かが私を助けたり説明したりできますか?なぜこのエラーが発生するのか、それを修正する方法は?