Order diff between backend and client with order_by_key()
まだ誰も着手していません。
評価
調査の方向性
提供された JSON を使用して db.reference("/test").order_by_key().limit_to_first(4).get() で報告内容を再現し、OrderedDict の順序を Firebase の order_by_key の動作と比較してください。このクエリのレスポンス処理を追跡し、返されたキーがデータベースの順序を保持していることを確認して、start_at によるページネーションで結果が重複しないようにしてください。
索引モデルが issue の本文から書いたものです。
説明
Describe your environment
- Operating System version: macOS 12.4
- Firebase SDK version: 6.1.0
- Firebase Product: database
- Python version: 3.7.9
- Pip version: 21.3.1
Describe the problem
When using order_by_key(), the order of the returned OrderedDict is not the same as the database making pagination very difficult
Steps to reproduce:
- Create a collection with this json in "/test" for example :
{
"123": {"myValue": true},
"100001": {"myValue": true},
"100002": {"myValue": true},
"100003": {"myValue": true},
"100004": {"myValue": true},
"100005": {"myValue": true}
}
- Query it with :
db.reference("/test").order_by_key().limit_to_first(4).get()
- Comparison :
Current :
OrderedDict([('100001', {'myValue': True}), ('100002', {'myValue': True}), ('100003', {'myValue': True}), ('123', {'myValue': True})])
Expected :
OrderedDict([('123', {'myValue': True}), ('100001', {'myValue': True}), ('100002', {'myValue': True}), ('100003', {'myValue': True})])
Comments
So according to this link, order should be the same as the collection but in the corresponding OrderedDict the order is not the same so if you want make a pagination strategy, it just loops as getting the last key of the OrderedDict returned and using it in start_at will return the same result over and over again.
- 主要言語
- Python
- スター
- 1.2k
- フォーク
- 359
- 平均マージ
- 5日 6分
- マージ済み PR(30日)
- 2
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
firebase/firebase-admin-python のほかの issue
-
api: remoteconfig
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
firebase/firebase-admin-python#957 · コメント 1 件 ·
-
api: database type: feature request
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
-
難易度 4/5 3〜5日 初心者へのやさしさ 45/100
firebase/firebase-admin-python#978 · コメント 1 件 ·
-
[FR] Support VERIFY_AND_CHANGE_EMAIL in generate_email_action_link (parity with firebase-admin-node) オープンapi: auth
firebase/firebase-admin-python#949 · コメント 2 件 · リアクション 1 件 · 担当者 1 名 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 43/100
firebase/firebase-admin-python#945 · コメント 1 件 · リアクション 1 件 ·
firebase/firebase-admin-python の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
syfoud/Simulated_Scepter#172 ·
-
A cancelled tests run makes the coverage comment workflow fail and reports it as a red check on main オープンarea: ci bug perceived difficulty: 3
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
Nitjsefnie-Harness-Commons/daedalus#921 · コメント 1 件 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 86/100
EleutherAI/lm-evaluation-harness#4207 ·
-
難易度 1/5 1時間未満 初心者へのやさしさ 92/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
ClickHouse/clickhouse-connect#1057 ·