Closed ggarcia92 closed 6 years ago
I want to sort found elements by updatedAt field which is created and updated by default.
I have the following code:
Model:
module.exports = { attributes: { id:{ type: "string", primaryKey: 'hash' }, title:{ type: "string", required: true }, category:{ type: "string", required: true }, subCategory:{ type: "string" }, }
Controller:
Anuncio.find({ where: { category: request.category, subCategory: request.subCategory }, sort: "1" }).exec((err, result) => { if (err) return next(err); return res.json(result); });
This code don't sort properly.
I already tried to create the attribute updatedAt with an index and I get "Cannot read property 'dynamoType' of undefined".
updatedAt
I want to sort found elements by updatedAt field which is created and updated by default.
I have the following code:
Model:
Controller:
This code don't sort properly.
I already tried to create the attribute
updatedAt
with an index and I get "Cannot read property 'dynamoType' of undefined".