FireBase 值未正确打印

FireBase value not printing properly

我需要获取集合的所有值,所以我做了

const q = query(collection(db, "IPAddresses"));
        const querySnapshot = await getDocs(q);
        querySnapshot.forEach((doc) => {
            var newAddress = document.createElement("Label");
            newAddress.innerHTML = JSON.stringify(doc.data());
            AddressDiv.appendChild(newAddress);
        });

唯一的问题是值显示如下

{"IPAddresses":"Address"}{"IPAddresses":"Address"}{"IPAddresses":"Address"}

我需要这样的

"Address" "Address" "Address" 

如果您只需要特定字段的值,则将该值设置为 innerHTML:

newAddress.innerHTML = doc.data().IPAddresses; // instead of JSON.stringify(doc.data())