首页 > 解决方案 > 在 Cloud Function Firebase 中创建 GeoHash(用于 GeoFire)

问题描述

我需要为我在 Firebase 上运行的云函数中的纬度、经度创建 Geohash。

我不需要我需要导入的内容以及最佳实践是什么。

目前这是我的index.js样子:

'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
});

标签: javascriptfirebasegeolocationgeocodinggeofire

解决方案


推荐阅读