Why are unauthorized document identifiers in italics highlighted in the Firestore console?

When I add a document with my own document identifier (it does not generate automatically), the document identifier node is italicized, as shown in the screenshot from the Firestore console. What is the reason for this?

My code to add data

const billingRef = db
      .collection('billing/test/2017/months/11')
      .doc();

  billingRef
      .set({ name: 'ABC' })
      .then(_ => {
        console.log('saved');
      })
      .catch(err => {
        console.log(err);
      });
Run codeHide result

The above code successfully adds the node, but adds in italics "test" and "months."

Screenshot 1 enter image description here

screenshot 2 enter image description herescreenshot 3enter image description here

My query gives a null result for such entries in firestore, following the code. How can I request all nodes under billing?

db.collection("billing").get().then(function(querySnapshot) {
    console.log(querySnapshot.size) // this is always 0
    querySnapshot.forEach(function(doc) {
        console.log(doc.id, " => ", doc.data());
    });
});
Run codeHide result
+7
source share
2 answers

, Firestore, " , , " ", , - , " null" ( ). , , null.

( "null" ), , .

, Firestore, , , , , .

+5

0

Source: https://habr.com/ru/post/1690487/


All Articles