firestore-php icon indicating copy to clipboard operation
firestore-php copied to clipboard

How to get id of new document

Open elmismopancho opened this issue 4 years ago • 1 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 = ??????

elmismopancho avatar May 13 '21 20:05 elmismopancho

Did you ever figure this one out?

chalamministries avatar Aug 17 '21 13:08 chalamministries