Skip to content
Advertisement

I am trying to get a users from firestore and store them in Map in javascript but for some reasone the map is empty

So the user Object has 5 attributes firstName , lastName,email,password and city.

I am getting the users with a method in class Users which is :

JavaScript

which returns this in chrome console:

JavaScript

I am trying to use credentials in a Map because every user will have a unique email which will be the key to the map.

Advertisement

Answer

If this.users.get() is async you will have to await the result before returning the usersMap.

JavaScript
Advertisement