When I view my database in the firebase console, it looks fine -- I see the following
xxxxx-nnnnnn-default-rtdb
- users
- 1
role: "admin
username: "me"
- 4
etc.
There is no user 0, 2 or 3, just 1 and 4, so this display is correct and makes sense.
But when I export the users table as json, what I get includes null entries for 0, 2 and 3, in addition to 1 and 4:
0: null
1:
role: "admin
username: "me"
2: null
3: null
4:
email: etc.
The data was built with a PHP script using kreait/firebase-php, and it only uploaded the non-null items, corresponding to records in my web server's database.
Also, when I try getting a snapshot of "users" using the Flutter
Firebase_database package, I get a null return, even though there are
numerous non-null entries I would have expected to be returned in the snapshot.
Any suggestions regarding where the nulls are coming from in the first place, or how to avoid getting a null snapshot in Flutter?