ahsankhatri / firestore-php

Firestore PHP Client (without gRPC extension)
MIT License
62 stars 57 forks source link

How to get id of new document #36

Open elmismopancho opened 3 years ago

elmismopancho commented 3 years ago

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 = ??????
chalamministries commented 3 years ago

Did you ever figure this one out?