Collection.orderBy(fieldPath: string, string: order): Collection

    指定查询排序条件

    如果需要对嵌套字段排序,需要用 "点表示法" 连接嵌套字段,比如 style.color 表示字段 style 里的嵌套字段 。

    按进度排升序取待办事项

    1. db.collection('todos')
    2. .orderBy('description', 'asc')
    3. .get()
    4. .then(console.log)