Skip to content

Commit 87163f9

Browse files
committed
Add info about ordering
Signed-off-by: Alex Saveau <[email protected]>
1 parent ca3362c commit 87163f9

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

database/README.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -301,3 +301,29 @@ new FirebaseIndexListAdapter<Chat>(this, Chat.class, android.R.layout.two_line_l
301301
```
302302

303303
`keyRef` is the location of your keys, and `dataRef` is the location of your data.
304+
305+
### A note on ordering:
306+
The order in which your receive your data depends on the order from `keyRef`, not `dataRef`:
307+
```json
308+
{
309+
"data": {
310+
// This order doesn't matter, the order is taken from keys/(user1 or user2).
311+
"3": true,
312+
"1": "some data",
313+
"2": 5
314+
},
315+
"keys": {
316+
// These two users have different orders for their data thanks to key side ordering.
317+
"user1": {
318+
"1": true,
319+
"2": true,
320+
"3": true
321+
},
322+
"user2": {
323+
"3": true,
324+
"2": true,
325+
"1": true
326+
}
327+
}
328+
}
329+
```

0 commit comments

Comments
 (0)