我是编码新手,实际上我正在制作我的第一个 Api。
我的问题是我尝试在我的 firestore 数据库中发布一些 Geopoint 但它看起来不可能这是我的代码如下:
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);
}
})();
});
错误:参数“纬度”的值不是有效数字。
同样的问题我不能将数据库用于任何时间戳。
关于如何做的任何想法,或者这至少可以通过 firestore 实现?我卡住了两天
小唯快跑啊
BIG阳
相关分类