File tree Expand file tree Collapse file tree 2 files changed +3
-3
lines changed
main/java/com/example/firestore/snippets
test/java/com/example/firestore/snippets Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -150,10 +150,10 @@ public List<QueryDocumentSnapshot> getAllDocuments() throws Exception {
150
150
*
151
151
* @return iterable of collection references.
152
152
*/
153
- public Iterable <CollectionReference > getCollections () throws Exception {
153
+ public Iterable <CollectionReference > listCollections () throws Exception {
154
154
// [START fs_get_collections]
155
155
Iterable <CollectionReference > collections =
156
- db .collection ("cities" ).document ("SF" ).getCollections ();
156
+ db .collection ("cities" ).document ("SF" ).listCollections ();
157
157
158
158
for (CollectionReference collRef : collections ) {
159
159
System .out .println ("Found subcollection with id: " + collRef .getId ());
Original file line number Diff line number Diff line change @@ -103,7 +103,7 @@ public void testGetSubcollections() throws Exception {
103
103
db .document ("cities/SF/landmarks/example" ).set (data ).get ();
104
104
105
105
Iterable <CollectionReference > collections =
106
- retrieveDataSnippets .getCollections ();
106
+ retrieveDataSnippets .listCollections ();
107
107
108
108
List <CollectionReference > collectionList = new ArrayList <>();
109
109
for (CollectionReference collRef : collections ) {
You can’t perform that action at this time.
0 commit comments