Skip to content
This repository was archived by the owner on Sep 29, 2025. It is now read-only.

Commit 53eac77

Browse files
authored
Update document.py
Add support for optional arguments in DocumentReference.get - mdowds#87
1 parent 0de34b1 commit 53eac77

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

mockfirestore/document.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from copy import deepcopy
22
from functools import reduce
33
import operator
4-
from typing import List, Dict, Any
4+
from typing import List, Dict, Any, Optional, Iterable
55
from mockfirestore import NotFound
66
from mockfirestore._helpers import (
77
Timestamp, Document, Store, get_by_path, set_by_path, delete_by_path
@@ -63,7 +63,13 @@ def __init__(self, data: Store, path: List[str],
6363
def id(self):
6464
return self._path[-1]
6565

66-
def get(self) -> DocumentSnapshot:
66+
def get(
67+
self,
68+
field_paths: Optional[Iterable[str]] = None,
69+
transaction: Any = None,
70+
retry: Any = None,
71+
timeout: Optional[float] = None,
72+
) -> DocumentSnapshot:
6773
return DocumentSnapshot(self, get_by_path(self._data, self._path))
6874

6975
def delete(self):

0 commit comments

Comments
 (0)