ahsankhatri / firestore-php

Firestore PHP Client (without gRPC extension)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How to get id of new document

elmismopancho opened this issue · comments

I've been looking at the docs and the code but I can't find a way to get the id of a new document. Is it possible?
Here's an example:

$firestoreClient = new FirestoreClient('xxx', 'yyyyyyyyyyyyyyyyyyyyyyy', [
     'database' => '(default)',
]);
$document = new FirestoreDocument;
$document->fillValues($data);
$firestoreClient->addDocument('my-collection', $document);
$newdocid = ??????

Did you ever figure this one out?