MichaelSolati / geofirestore-js

Location-based querying and filtering using Firebase Firestore.

Home Page:https://geofirestore.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Hangs on .update()

lucasgrinspan opened this issue · comments

  • Operating System version: macOS 10.15.6
  • firebase-admin version: 9.3.0
  • GeoFirestore version: 4.3.0

I'm trying to update a document using firebase admin but making a call with .update() hangs, the modification doesn't happen and the promise doesn't resolve.

Am I missing something obvious?

let admin = require("firebase-admin");
let GeoFirestore = require("geofirestore").GeoFirestore;

admin.initializeApp({ /* ... */});

const firestore = admin.firestore();
const geofirestore = new GeoFirestore(firestore);

module.exports.saveTruck = saveTruck = (id, data) => {
  return geofirestore.collection("trucks")
  .doc("docID")
  .update({
    name: data.name,
   coordinates: new firebase.firestore.GeoPoint(
     data.latitude,
     data.longitude
    ),
})