title: DocumentReference return sensitive data - Firestore
body: <p>I have a "post" and "user" collection, in the Post I attached "userId" as a reference to the user document</p>
  
  <p>Everything works perfectly except the get().data() method I call on the Post document exposes all sensitive data (which I will send to the clients via Express server)</p>
  
  <pre><code>const ref = (await firestore.doc(...).get()).data()
    res.json({
      success: true,
      msg: ref,
    });
  </code></pre>
  
  <p>This is what I get in the ref variable:</p>
  
  <pre><code>{
    "success": true,
    "msg": {
      "foo": "bar",
      "userId": {
        "_firestore": {
          "_settings": {
            "credentials": {
              "private_key": "-----BEGIN PRIVATE KEY---------END PRIVATE KEY-----\n", &lt;--- Big problem
              "client_email": "..."
            },
            "projectId": "cpanel-9ac21",
            "firebaseVersion": "8.9.0",
            "libName": "gccl",
            "libVersion": "3.3.3 fire/8.9.0",
            "servicePath": "firestore.googleapis.com",
            "port": 443,
            "clientConfig": {},
            "scopes": [
              "https://www.googleapis.com/auth/cloud-platform",
              "https://www.googleapis.com/auth/datastore"
            ]
          },
          "_settingsFrozen": true,
          "_serializer": {},
          "_projectId": "cpanel-9ac21",
          "_lastSuccessfulRequest": 1578712168345,
          "_backoffSettings": {
            "initialDelayMs": 100,
            "maxDelayMs": 60000,
            "backoffFactor": 1.3
          },
          "_preferTransactions": false,
          "_clientPool": {
            "concurrentOperationLimit": 100,
            "maxIdleClients": 1,
            "activeClients": {},
            "terminated": false
          }
        },
        "_path": {
          "segments": [
            "users",
            "TXMF00S2PugwdwO5ge3vwQA6pV63"
          ]
        }
      },
      "foo": "bar"
    }
  }
  </code></pre>
  
  <p>I also searched on the Internet but unfortunately didn't find the answer/solution</p>