rowyio / rowy

Low-code backend platform. Manage database on spreadsheet-like UI and build cloud functions workflows in JS/TS, all in your browser.
http://rowy.io
Other
5.95k stars 480 forks source link

GeoPoint with Derivative #885

Closed Prayer-RecycleSmart closed 1 year ago

Prayer-RecycleSmart commented 1 year ago

Describe the bug Can get the function to return a GeoPoint

To Reproduce

const derivative:Derivative = async ({row,ref,db,storage,auth})=>{
    const { GeoPoint } = require('firebase/firestore');
    const test = new GeoPoint(-90,180);
    return test;
  }

Expected behavior Should add a geopoint in Firestone/rowy

Desktop (please complete the following information):

shamsmosowi commented 1 year ago

hi @Prayer-RecycleSmart Derivatives run on the server and use firebase-admin sdk so it you need you use the firebase-admin npm instead of firebase

here's the working derivative

const derivative:Derivative = async ({row,ref,db,storage,auth})=>{
    const { GeoPoint } = require('firebase-admin/firestore');
    const test = new GeoPoint(-90,180);
    return test;
  }
Prayer-RecycleSmart commented 1 year ago

Thanks @shamsmosowi - love this product!