title: How can I get the id of a inserted document firebase-admin
body: <p>I am handling some documents with firebase realtime database. I need to delete a document that I don't have the access to read it client side via SDK. In order to do that I need to know what is the id, so I should store it in my db (mongo) and when I need to delete a document on firebase I just get it from my DB and the I delete it.</p>
  <p>I took a look <a href="https://stackoverflow.com/questions/48740430/firestore-how-to-get-document-id-after-adding-a-document-to-a-collection">to this answer</a> but it doesn't work for me.</p>
  <p>I insert documents into my firebase DB with this method (server side using <code>firebase-admin</code>)</p>
  <pre><code>const writeNotification = (uid: string, notification: INotification) =&gt; {
    const db = admin.database();
    const notsRef = db.ref(`notifications/${uid}`);
    notsRef.push({
      ..._.omit(notification, 'to'),
    });
  };
  </code></pre>
  <p>If I do <code>notsRef.id</code> I get <code>undefined</code>.</p>
  <p>How can I get the ID of my document that I have just inserted?</p>
  <p>p.s. my documents are organized like this:</p>
  <p><a href="https://i.stack.imgur.com/wbYGx.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/wbYGx.png" alt="enter image description here" /></a></p>