Closed mataide closed 6 years ago
What is the Channel
schema?
_dynogels2.default.define('Channel-' + [constants.PROFILE], {
hashKey: 'userId',
timestamps: true,
tableName: 'Channel-' + [constants.PROFILE],
schema: _joi2.default.object({
userId: _joi2.default.string(),
channels: _joi2.default.array().items(_joi2.default.string()).unique()
}).unknown(true).options({ stripUnknown: true })
});
DynamoDB does not support $add
and $del
on arrays, only on sets. You would need to use a string set (dynogels.types.stringSet()
) in the schema, for example.
This $del operation gives an error:
"Invalid UpdateExpression: Incorrect operand type for operator or function; operator: DELETE, operand type: STRING\"
Object in dynamodb: