Ejemplo n.º 1
0
 def document(self, name: Optional[str] = None) -> DocumentReference:
     collection = get_by_path(self._data, self._path)
     if name is None:
         name = generate_random_string()
     new_path = self._path + [name]
     if name not in collection:
         set_by_path(self._data, new_path, {})
     return DocumentReference(self._data, new_path, parent=self)
Ejemplo n.º 2
0
 def document(self, path):
     return DocumentReference(self._data, path, parent=None)