Order diff between backend and client with order_by_key()
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 55/100
Direzione di ricerca
Riproduci il report con db.reference("/test").order_by_key().limit_to_first(4).get() usando il JSON fornito e confronta l’ordine di OrderedDict con il comportamento di order_by_key di Firebase. Traccia la gestione della risposta per questa query e verifica che le chiavi restituite preservino l’ordine del database, in modo che la paginazione con start_at non ripeta i risultati.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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.
- Lingua principale
- Python
- Stelle
- 1.2k
- Fork
- 359
- Merge medio
- 5g 6m
- PR unite (30g)
- 2
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di firebase/firebase-admin-python
-
api: remoteconfig
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
firebase/firebase-admin-python#957 · 1 commento ·
-
api: database type: feature request
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 45/100
firebase/firebase-admin-python#978 · 1 commento ·
-
[FR] Support VERIFY_AND_CHANGE_EMAIL in generate_email_action_link (parity with firebase-admin-node) Apertaapi: auth
firebase/firebase-admin-python#949 · 2 commenti · 1 reazione · 1 assegnatario ·
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 43/100
firebase/firebase-admin-python#945 · 1 commento · 1 reazione ·
Tutte le issue di firebase/firebase-admin-python
Issue simili
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 90/100
learningequality/ricecooker#747 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
BSData/horus-heresy-3rd-edition#3171 ·
-
enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
run-llama/llama_index#23199 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
KhronosGroup/glTF-Blender-IO#2769 ·