第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問(wèn)題,去搜搜看,總會(huì)有你想問(wèn)的

如何使用 firebase 從我的 Api 發(fā)布 GeoPoint

如何使用 firebase 從我的 Api 發(fā)布 GeoPoint

慕容森 2023-05-25 18:14:43
我是編碼新手,實(shí)際上我正在制作我的第一個(gè) Api。我的問(wèn)題是我嘗試在我的 firestore 數(shù)據(jù)庫(kù)中發(fā)布一些 Geopoint 但它看起來(lái)不可能這是我的代碼如下:const db = admin.firestore();const pointGps = new admin.firestore.GeoPoint(Number, Number);app.post('/api/createrdv', (req, res) => {    (async () => {        try {            await db.collection('rvlist').doc() // CREATION AUTO DE L'ID // POUR CREER AVEC ID PERSO ('/' + req.body.id + '/')                .create({                  //id: req.body.id,                    latlong: pointGps({lat: req.body.lat, lng: req.body.lng}),                    name: req.body.name,                    phone: req.body.phone,                    psnumber: req.body.psnumber,                    rvtime: req.body.rvtime,                    vu: req.body.vu                });            return res.status(200).send();        } catch (error) {            console.log(error);            return res.status(500).send(error);        }    })();});錯(cuò)誤:參數(shù)“緯度”的值不是有效數(shù)字。同樣的問(wèn)題我不能將數(shù)據(jù)庫(kù)用于任何時(shí)間戳。關(guān)于如何做的任何想法,或者這至少可以通過(guò) firestore 實(shí)現(xiàn)?我卡住了兩天
查看完整描述

2 回答

?
小唯快跑啊

TA貢獻(xiàn)1863條經(jīng)驗(yàn) 獲得超2個(gè)贊

嘗試這個(gè):


const db = admin.firestore();



app.post('/api/createrdv', (req, res) => {

    (async () => {

        try {

            await db.collection('rvlist').doc() // CREATION AUTO DE L'ID // POUR CREER AVEC ID PERSO ('/' + req.body.id + '/')

            .create({


                  //id: req.body.id,

                    latlong: new GeoPoint(Number(req.body.lat), 

                                          Number(req.body.lng)),

                    name: req.body.name,

                    phone: req.body.phone,

                    psnumber: req.body.psnumber,

                    rvtime: req.body.rvtime,

                    vu: req.body.vu


                });


            return res.status(200).send();


        } catch (error) {


            console.log(error);

            return res.status(500).send(error);

        }

    })();

});


查看完整回答
反對(duì) 回復(fù) 2023-05-25
?
BIG陽(yáng)

TA貢獻(xiàn)1859條經(jīng)驗(yàn) 獲得超6個(gè)贊

app.post('/api/create', (req, res) => {

(async () => {

? ? try {

? ? ? ? await db.collection('psdata').doc() // CREATION DE L'ID AUTOMATIQUE // POUR CREER AVEC ID PERSO ('/' + req.body.id + '/') //

? ? ? ? ? ? .create({


? ? ? ? ? ? ? //id: req.body.id,

? ? ? ? ? ? ? ? latlong: new admin.firestore.GeoPoint(Number(req.body.lat),

? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? Number(req.body.lng)),

? ? ? ? ? ? ? ? city: req.body.city,

? ? ? ? ? ? ? ? name: req.body.name,

? ? ? ? ? ? ? ? phone: req.body.phone,

? ? ? ? ? ? ? ? psnumber: req.body.psnumber,

? ? ? ? ? ? ? ? speciality: req.body.speciality,

? ? ? ? ? ? ? ? streetadress: req.body.streetadress,

? ? ? ? ? ? ? ? zipcode: req.body.zipcode,

? ? ? ? ? ? ? ??


? ? ? ? ? ? });


? ? ? ? return res.status(200).send();


查看完整回答
反對(duì) 回復(fù) 2023-05-25
  • 2 回答
  • 0 關(guān)注
  • 158 瀏覽
慕課專(zhuān)欄
更多

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購(gòu)課補(bǔ)貼
聯(lián)系客服咨詢(xún)優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)