Getting a specific field in a document returned from firebase firestore
Or you can get the field value directly from the DocumentSnapshot
:
var firstName = doc.get("first");
var lastName = doc.get("last");
doc.data()
is just a regular JavaScript object with the contents of the document you just read:
var data = doc.data();
var firstName = data.first;
var lastName = data.last;