首页 > 解决方案 > 如何更新 Cloud Firestore js 中的数组

问题描述

我正在与 Google 的 Cloud Firestore 合作,但我无法更新数组......所以,如果有人有解决方案。

docRef.get()
    .then(function(doc) { 
        if ( doc.exists ) { db.collection("collection")
        .doc("document").update({ "array"[0]: true }) 
    .then(function() { 
              console.log("Changed !"); 
    }) 
} })

标签: javascriptarraysfirebasegoogle-cloud-firestore

解决方案


推荐阅读