2 回答
TA贡献1863条经验 获得超2个赞
尝试这个:
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);
}
})();
});
TA贡献1859条经验 获得超6个赞
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();
添加回答
举报