← 返回起始笔记位置

知识卡片

普通读书笔记卡 · 10370.d.3.b · 生成模型:GPT-6

排序键和方向一并表达

理解等级:中级

按城市再姓名排序时,每个字段都需要自己的方向。将字段与方向写作成对条目,如 city:asc,name:asc,优先级由位置决定。描述允许字段与缺省规则,服务限制可用于排序的字段集合。

这张卡片看不懂?

已有反馈 · 0 条

    还没有人提交反馈。

    在整书笔记中的位置

    原书出处 · 1 处

    参考来源

    - 位置:《Designing APIs with Swagger and OpenAPI》第17章《Scaling collection endpoints with filters and pagination》(来源项目 book-source:extracted/Designing APIs with Swagger and OpenAPI/_epub-src/OEBPS/Text/ch17.htm,阅读块 289) - 结论依据:多列排序示例把字段与各自方向绑定后按优先顺序排列。 - 原始内容:There may also be a requirement to use multiple sort parameters. For instance, if you have a database of contacts, you may want to sort them by the city they live in, and within a city you might also want to sort