Skip to content

Commit b2fcecc

Browse files
schmidt-sebastianJustinBeckwith
authored andcommitted
refactor(deprecation)!: remove deprecated getCollections() (#624)
1 parent 2ce6516 commit b2fcecc

6 files changed

Lines changed: 8 additions & 62 deletions

File tree

handwritten/firestore/dev/src/index.ts

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -812,19 +812,6 @@ export class Firestore {
812812
return rootDocument.listCollections();
813813
}
814814

815-
/**
816-
* Fetches the root collections that are associated with this Firestore
817-
* database.
818-
*
819-
* @deprecated Use `.listCollections()`.
820-
*
821-
* @returns {Promise.<Array.<CollectionReference>>} A Promise that resolves
822-
* with an array of CollectionReferences.
823-
*/
824-
getCollections() {
825-
return this.listCollections();
826-
}
827-
828815
/**
829816
* Retrieves multiple documents from Firestore.
830817
*

handwritten/firestore/dev/src/reference.ts

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -307,18 +307,6 @@ export class DocumentReference implements Serializable {
307307
});
308308
}
309309

310-
/**
311-
* Fetches the subcollections that are direct children of this document.
312-
*
313-
* @deprecated Use `.listCollections()`.
314-
*
315-
* @returns {Promise.<Array.<CollectionReference>>} A Promise that resolves
316-
* with an array of CollectionReferences.
317-
*/
318-
getCollections(): Promise<CollectionReference[]> {
319-
return this.listCollections();
320-
}
321-
322310
/**
323311
* Create a document with the provided object values. This will fail the write
324312
* if a document exists at its location.

handwritten/firestore/dev/test/document.ts

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1952,17 +1952,13 @@ describe('listCollections() method', () => {
19521952
};
19531953

19541954
return createInstance(overrides).then(firestore => {
1955-
// We are using `getCollections()` to ensure 100% code coverage
1956-
return (
1957-
firestore
1958-
.doc('coll/doc')
1959-
// tslint:disable-next-line deprecation
1960-
.getCollections()
1961-
.then(collections => {
1962-
expect(collections[0].path).to.equal('coll/doc/first');
1963-
expect(collections[1].path).to.equal('coll/doc/second');
1964-
})
1965-
);
1955+
return firestore
1956+
.doc('coll/doc')
1957+
.listCollections()
1958+
.then(collections => {
1959+
expect(collections[0].path).to.equal('coll/doc/first');
1960+
expect(collections[1].path).to.equal('coll/doc/second');
1961+
});
19661962
});
19671963
});
19681964
});

handwritten/firestore/dev/test/index.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -732,9 +732,7 @@ describe('listCollections() method', () => {
732732
};
733733

734734
return createInstance(overrides).then(firestore => {
735-
// We are using `getCollections()` to ensure 100% code coverage
736-
// tslint:disable-next-line deprecation
737-
return firestore.getCollections().then(collections => {
735+
return firestore.listCollections().then(collections => {
738736
expect(collections[0].path).to.equal('first');
739737
expect(collections[1].path).to.equal('second');
740738
});

handwritten/firestore/dev/test/typescript.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,6 @@ xdescribe('firestore.d.ts', () => {
7373
firestore
7474
.getAll(docRef1, docRef2, {fieldMask: ['foo', new FieldPath('foo')]})
7575
.then((docs: DocumentSnapshot[]) => {});
76-
// tslint:disable-next-line deprecation
77-
firestore.getCollections().then((collections: CollectionReference[]) => {});
7876
firestore
7977
.listCollections()
8078
.then((collections: CollectionReference[]) => {});
@@ -154,8 +152,6 @@ xdescribe('firestore.d.ts', () => {
154152
const parent: CollectionReference = docRef.parent;
155153
const path: string = docRef.path;
156154
const subcollection: CollectionReference = docRef.collection('coll');
157-
// tslint:disable-next-line deprecation
158-
docRef.getCollections().then((collections: CollectionReference[]) => {});
159155
docRef.listCollections().then((collections: CollectionReference[]) => {});
160156
docRef.get().then((snapshot: DocumentSnapshot) => {});
161157
docRef

handwritten/firestore/types/firestore.d.ts

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -166,16 +166,6 @@ declare namespace FirebaseFirestore {
166166
getAll(...documentRefsOrReadOptions: Array<DocumentReference|ReadOptions>):
167167
Promise<DocumentSnapshot[]>;
168168

169-
/**
170-
* Fetches the root collections that are associated with this Firestore
171-
* database.
172-
*
173-
* @deprecated Use `.listCollections()`.
174-
*
175-
* @returns A Promise that resolves with an array of CollectionReferences.
176-
*/
177-
getCollections() : Promise<CollectionReference[]>;
178-
179169
/**
180170
* Fetches the root collections that are associated with this Firestore
181171
* database.
@@ -571,15 +561,6 @@ declare namespace FirebaseFirestore {
571561
*/
572562
collection(collectionPath: string): CollectionReference;
573563

574-
/**
575-
* Fetches the subcollections that are direct children of this document.
576-
*
577-
* @deprecated Use `.listCollections()`.
578-
*
579-
* @returns A Promise that resolves with an array of CollectionReferences.
580-
*/
581-
getCollections() : Promise<CollectionReference[]>;
582-
583564
/**
584565
* Fetches the subcollections that are direct children of this document.
585566
*

0 commit comments

Comments
 (0)