We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hello jerome!
Is it possible to add an empty collection? (without document)
I tried this:
public static function addEmptyCollection (string $collection) { $db = self::connectFirestore(); $db->collection($collection)->document('empty')->set([]); $db->collection($collection)->document('empty')->delete(); }
But it also removes the collection ...
You have an idea ? Thank you.
The text was updated successfully, but these errors were encountered:
That's not possible by design: if a collection is empty, it is as if it doesn't exist. It's actually a little bit similar to PHP:
$var = null; // exists, but nothing is in it
But, of course, it's not that simple 😅
https://stackoverflow.com/a/57858387/284325
https://groups.google.com/g/google-cloud-firestore-discuss/c/o3tUFJpPYKc?pli=1
Sorry, something went wrong.
Ok I understood. Thanks Jerome!
No branches or pull requests
Hello jerome!
Is it possible to add an empty collection? (without document)
I tried this:
But it also removes the collection ...
You have an idea ?
Thank you.
The text was updated successfully, but these errors were encountered: