【发布时间】:2021-09-12 21:13:05
【问题描述】:
使用 nodejs 进行放大和数据存储并做出反应。
我有message的模型
type Message
@model
@auth(rules: [{allow: owner, operations: [read, create, update, delete]}]) {
id: ID!
content: String!
}
我想获取所有消息并按降序排序。 我想做什么
const messages = await DataStore.query(Message, Predicates.ALL, {
sort: s => s.createdAt(SortDirection.DESCENDING),
page: 0,
limit: 20
});
我的解决方案似乎根本不影响排序。我错过了什么?
【问题讨论】:
标签: aws-lambda aws-amplify aws-amplify-cli