My code is working fine until db.collection("OrderId").doc("D9XjS3efiV12epxQcgYA").get().then since it returns "firestoreFunc runnig" when I uncomment the line, but not logging and returns nothing inside db.collection("OrderId").doc("D9XjS3efiV12epxQcgYA").get().then.
How can I get access to Firestore using HTTP trigger?
const functions = require('firebase-functions');
const admin = require('firebase-admin');
admin.initializeApp();
const db = admin.firestore();
exports.firestoreFunc = functions.https.onCall((data, context) => {
//return "firestoreFunc running";
db.collection("OrderId").doc("D9XjS3efiV12epxQcgYA").get().then(snapshot => {
console.log("log : 22");
return 22;
}).catch(reason => {
})
});