If I have a database like
users: {
user1: {
name:\'qwert\',
id: 123,
num: 9999
},
user2: {
name:\'zxcvb\',
id: 456,
num:
There is no way to select only the names from your current data model, Firebase always retrieves full nodes. So you will either have to do what Peter answered, reading all data but extracting the user name client side, or you will have to modify you data model to allow the use-case.
The latter is quite simple. If you want to load a list of user names, you should store a list of user names in the database:
users: {
user1: {
name:'qwert',
id: 123,
num: 9999
},
user2: {
name:'zxcvb',
id: 456,
num: 8888
}
},
usernames: {
user1: 'qwert',
user2: 'zxcvb'
}
With this structure, it is trivial to read only the names.
Also see: