I'm trying to save an item to DynamoDB table using dynogels Orm with joi for types.
One of the properties of the saved item is files
which is an array.
Initially, I would like this value to be an empty array.
const projectSchema: SchemaType = {
name: joi.string().optional(),
description: joi.string().optional().allow(null, ""),
**files: joi.array().default([ ]),**
user: joi.alternatives().try(joi.object(), joi.string()).required(),
config: joi.object().optional(),
background: joi.string().optional().allow(null, ""),
status: joi.string().optional(),
metadata: joi.object(),
key: joi.string().optional(),
email: joi.string().optional(),
published: joi.boolean().default(true),
};
ive tried as seen above, and also by chaining other functions like valid()
, allow()
.
also ive tried to remove the array()
and replaced it with any()
but nothing seems to work. The item is being saved to the database without the files.
Is there anyone who had experience with that?