我最近一直在使用带有云功能的Firebase,这个问题突然出现在我的脑海中。
如果在我的云函数中,使用 Firebase Admin SDK 在单个函数调用中对同一文档执行多次读取,它会算作数据库中的多次读取还是会缓存数据?
例子:
await admin.firestore().collection("users").doc("user_id_here").get();
await admin.firestore().collection("users").doc("user_id_here").get();
await admin.firestore().collection("users").doc("user_id_here").get();
Run Code Online (Sandbox Code Playgroud)
上面的代码会导致多次读取还是仅一次?
firebase google-cloud-functions firebase-admin google-cloud-firestore