Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(deprecation)!: remove deprecated getCollections() #624

Merged
merged 2 commits into from May 15, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
13 changes: 0 additions & 13 deletions dev/src/index.ts
Expand Up @@ -812,19 +812,6 @@ export class Firestore {
return rootDocument.listCollections();
}

/**
* Fetches the root collections that are associated with this Firestore
* database.
*
* @deprecated Use `.listCollections()`.
*
* @returns {Promise.<Array.<CollectionReference>>} A Promise that resolves
* with an array of CollectionReferences.
*/
getCollections() {
return this.listCollections();
}

/**
* Retrieves multiple documents from Firestore.
*
Expand Down
12 changes: 0 additions & 12 deletions dev/src/reference.ts
Expand Up @@ -307,18 +307,6 @@ export class DocumentReference implements Serializable {
});
}

/**
* Fetches the subcollections that are direct children of this document.
*
* @deprecated Use `.listCollections()`.
*
* @returns {Promise.<Array.<CollectionReference>>} A Promise that resolves
* with an array of CollectionReferences.
*/
getCollections(): Promise<CollectionReference[]> {
return this.listCollections();
}

/**
* Create a document with the provided object values. This will fail the write
* if a document exists at its location.
Expand Down
18 changes: 7 additions & 11 deletions dev/test/document.ts
Expand Up @@ -1952,17 +1952,13 @@ describe('listCollections() method', () => {
};

return createInstance(overrides).then(firestore => {
// We are using `getCollections()` to ensure 100% code coverage
return (
firestore
.doc('coll/doc')
// tslint:disable-next-line deprecation
.getCollections()
.then(collections => {
expect(collections[0].path).to.equal('coll/doc/first');
expect(collections[1].path).to.equal('coll/doc/second');
})
);
return firestore
.doc('coll/doc')
.listCollections()
.then(collections => {
expect(collections[0].path).to.equal('coll/doc/first');
expect(collections[1].path).to.equal('coll/doc/second');
});
});
});
});
4 changes: 1 addition & 3 deletions dev/test/index.ts
Expand Up @@ -732,9 +732,7 @@ describe('listCollections() method', () => {
};

return createInstance(overrides).then(firestore => {
// We are using `getCollections()` to ensure 100% code coverage
// tslint:disable-next-line deprecation
return firestore.getCollections().then(collections => {
return firestore.listCollections().then(collections => {
expect(collections[0].path).to.equal('first');
expect(collections[1].path).to.equal('second');
});
Expand Down
4 changes: 0 additions & 4 deletions dev/test/typescript.ts
Expand Up @@ -73,8 +73,6 @@ xdescribe('firestore.d.ts', () => {
firestore
.getAll(docRef1, docRef2, {fieldMask: ['foo', new FieldPath('foo')]})
.then((docs: DocumentSnapshot[]) => {});
// tslint:disable-next-line deprecation
firestore.getCollections().then((collections: CollectionReference[]) => {});
firestore
.listCollections()
.then((collections: CollectionReference[]) => {});
Expand Down Expand Up @@ -154,8 +152,6 @@ xdescribe('firestore.d.ts', () => {
const parent: CollectionReference = docRef.parent;
const path: string = docRef.path;
const subcollection: CollectionReference = docRef.collection('coll');
// tslint:disable-next-line deprecation
docRef.getCollections().then((collections: CollectionReference[]) => {});
docRef.listCollections().then((collections: CollectionReference[]) => {});
docRef.get().then((snapshot: DocumentSnapshot) => {});
docRef
Expand Down
19 changes: 0 additions & 19 deletions types/firestore.d.ts
Expand Up @@ -166,16 +166,6 @@ declare namespace FirebaseFirestore {
getAll(...documentRefsOrReadOptions: Array<DocumentReference|ReadOptions>):
Promise<DocumentSnapshot[]>;

/**
* Fetches the root collections that are associated with this Firestore
* database.
*
* @deprecated Use `.listCollections()`.
*
* @returns A Promise that resolves with an array of CollectionReferences.
*/
getCollections() : Promise<CollectionReference[]>;

/**
* Fetches the root collections that are associated with this Firestore
* database.
Expand Down Expand Up @@ -571,15 +561,6 @@ declare namespace FirebaseFirestore {
*/
collection(collectionPath: string): CollectionReference;

/**
* Fetches the subcollections that are direct children of this document.
*
* @deprecated Use `.listCollections()`.
*
* @returns A Promise that resolves with an array of CollectionReferences.
*/
getCollections() : Promise<CollectionReference[]>;

/**
* Fetches the subcollections that are direct children of this document.
*
Expand Down