title: How set field values for a firestore documents as a json
body: <p>During the execution of this code I want to create a json with contain as a value the document field (key and value) of a subdocument. </p>
  
  <pre><code>function getobjectItemsById(id){
    var objectItemsRef = db.collection(collectionName).doc(id).collection(subCollection);
    let object_items = [];
    return objectItemsRef.get()
        .then(snapshot =&gt; {
            snapshot.forEach(item =&gt; {
                let object_item = {};
                object_item.id = item.id;
                object_item.object_item = item.data();
                console.log(item.data()); 
                object_items.push(object_item);
            })
            return object_items;
        })
  }
  </code></pre>
  
  <p>But when I return this object in output whit:</p>
  
  <pre><code>console.log(objects)
  </code></pre>
  
  <p>My output:</p>
  
  <blockquote>
    <p>[object Object] [object Object]</p>
  </blockquote>
  
  <p>How can I receive correct key and value?</p>