I want to get data from a Firestore Database, however, instead of getting an Array of 1 element, I get [Al] which I'm not sure what it is.
This is the code I have in my Index.html. I have changed the information inside the config object for security reasons here.
<!-- The core Firebase JS SDK is always required and must be listed first -->
<script src="https://www.gstatic.com/firebasejs/7.14.5/firebase-app.js"></script>
<script src="https://www.gstatic.com/firebasejs/7.14.5/firebase-firestore.js"></script>
<!-- TODO: Add SDKs for Firebase products that you want to use
https://firebase.google.com/docs/web/setup#available-libraries -->
<script src="https://www.gstatic.com/firebasejs/7.14.5/firebase-analytics.js"></script>
<script>
// Your web app's Firebase configuration
var firebaseConfig = {
apiKey: "my api key",
authDomain: "demo",
databaseURL: "my url",
projectId: "my project",
storageBucket: "bucket",
messagingSenderId: "1051539927876",
appId: "my app id",
measurementId: "0000000000"
};
// Initialize Firebase
firebase.initializeApp(firebaseConfig);
var db = firebase.firestore();
firebase.analytics();
</script>
<script src="app.js"></script>
And this is what I have inside my app.js file
db.collection('cafes').get().then((snapshot) => {
console.log(snapshot.docs);
}).catch(err => {
console.log(err);
});