File tree Expand file tree Collapse file tree 1 file changed +26
-4
lines changed Expand file tree Collapse file tree 1 file changed +26
-4
lines changed Original file line number Diff line number Diff line change @@ -27,6 +27,12 @@ You can build paths to your data by using the ``collection()`` and ``document()`
27
27
28
28
..
29
29
30
+ .. note ::
31
+ The methods available/used after ``collection() `` method and
32
+ ``document() `` method are **NOT SAME **. Both method is a
33
+ reference to different classes with different methods in them.
34
+
35
+
30
36
Save Data
31
37
---------
32
38
@@ -53,6 +59,26 @@ the collection named ``Movies``, use ``set()`` method.
53
59
document.
54
60
55
61
62
+
63
+ To store data in a collection named ``Marvels `` within an auto
64
+ generated document ID, use ``add() `` method.
65
+
66
+ .. code-block :: python
67
+
68
+ data = {
69
+ " name" : " Iron Man" ,
70
+ " lead" : {
71
+ " name" : " Robert Downey Jr."
72
+ },
73
+ ' cast' : [' Gwyneth Paltrow' ]
74
+ ' released' : False ,
75
+ ' prequel' : None
76
+ }
77
+
78
+ id = fsdb.collection(' Marvels' ).add(data)
79
+ ..
80
+
81
+
56
82
Read Data
57
83
---------
58
84
@@ -86,10 +112,6 @@ it contains) of an collection ``Marvels``, use ``get()`` method.
86
112
fsdb.collection(' Marvels' ).get()
87
113
..
88
114
89
- .. note ::
90
- The ``get() `` method use after ``collection() `` method and
91
- ``document() `` method are **NOT SAME **. They both accept and
92
- return different type of values.
93
115
94
116
Update Data
95
117
-----------
You can’t perform that action at this time.
0 commit comments