I implemented a query in Express to retrieve my data. Below is the code for my Express function:
app.get('/locatii', (req, res) => {
const geofirestore = new GeoFirestore(db);
const geocollection = geofirestore.collection('locatii2');
const query = geocollection.near({
center: new firebase.firestore.GeoPoint(45.831922, 27.431149),
radius: 3000
});
query.get().then(snap => {
console.log(snap.docs())
let places = [];
snap.forEach(doc => {
places.push(doc.data());
console.log(doc.data())
});
res.json(places);
})
.catch(err => res.send(err));
});
Here is the structure of my Firestore database: https://i.sstatic.net/VgMML.png. However, when I access my endpoint, it does not display any data in the console or in Postman. I am unsure of what I missed. Thank you!