aboutsummaryrefslogtreecommitdiff
path: root/src/server/database.ts
diff options
context:
space:
mode:
authorAbdullah Ahmed <abdullah_ahmed@brown.edu>2019-06-29 19:25:38 -0400
committerAbdullah Ahmed <abdullah_ahmed@brown.edu>2019-06-29 19:25:38 -0400
commit82f61a9ff5406326a8bae736a63ddae7a386a181 (patch)
tree92fbbc7a35866c62618f31ec688fcd387116d9c2 /src/server/database.ts
parent881df5e1255681a306af2d9f78b092b3688ad38c (diff)
parent8e6caaf2a4f9f5c9777719a85dcacf4922830c04 (diff)
Merge branch 'text_box_ab' of https://github.com/browngraphicslab/Dash-Web into text_box_ab
Diffstat (limited to 'src/server/database.ts')
-rw-r--r--src/server/database.ts4
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)));