1

I need to create a Geohash for a latitude, longitude in a cloud function I'm running on Firebase.

I don't need what I need to import and what best practice is.

At the moment this is what my index.js looks like:

'use strict';

const _ = require('lodash');
const functions = require('firebase-functions');
const admin = require('firebase-admin');
admin.initializeApp();

exports.gameCreated = functions.database.ref('/games/{gameId}').onCreate((snap, context) => {
    // This is where I need to create the geohash
});
Peter Warbo
  • 11,136
  • 14
  • 98
  • 193
  • https://stackoverflow.com/questions/37393524/how-to-set-geofire-in-node-js? – Frank van Puffelen Oct 20 '18 at 04:34
  • @FrankvanPuffelen thanks! although I'm looking for a way to retrieve the Geohash string to create the update myself because in my cloud function I want to do a multi location update and I don't want to use GeoFire.set(). Seems there is no way to do it in official GeoFire.js but I found something here https://github.com/firebase/geofire-js/pull/132 – Peter Warbo Oct 20 '18 at 13:19

0 Answers0