diff options
author | yipstanley <stanley_yip@brown.edu> | 2019-06-18 10:10:58 -0400 |
---|---|---|
committer | yipstanley <stanley_yip@brown.edu> | 2019-06-18 10:10:58 -0400 |
commit | c50ba1c4cc01d5cd085dee0dae6f633164efeb80 (patch) | |
tree | f9d0208d5883939dfbafccf0f9173be0512b1e57 /src/server/database.ts | |
parent | cc032e2f60015728f64f46ef009c9306e36746a0 (diff) | |
parent | 64e6a941639aab8d7109178aa151a50909547309 (diff) |
Merge branch 'master' of https://github.com/browngraphicslab/Dash-Web
Diffstat (limited to 'src/server/database.ts')
-rw-r--r-- | src/server/database.ts | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/server/database.ts b/src/server/database.ts index 70b3efced..d240bd909 100644 --- a/src/server/database.ts +++ b/src/server/database.ts @@ -120,9 +120,9 @@ export class Database { } } - public query(query: any): Promise<mongodb.Cursor> { + public query(query: any, collectionName = "newDocuments"): Promise<mongodb.Cursor> { if (this.db) { - return Promise.resolve<mongodb.Cursor>(this.db.collection('newDocuments').find(query)); + return Promise.resolve<mongodb.Cursor>(this.db.collection(collectionName).find(query)); } else { return new Promise<mongodb.Cursor>(res => { this.onConnect.push(() => res(this.query(query))); |