diff options
author | madelinegr <laura_wilson@brown.edu> | 2019-02-13 17:40:08 -0500 |
---|---|---|
committer | madelinegr <laura_wilson@brown.edu> | 2019-02-13 17:40:08 -0500 |
commit | bb3ebfa2e3176fdfb648cb7da052e07989fee050 (patch) | |
tree | 95bca297ca99f9bacc4512c44ab573ef5ce7bdae /src/server/database.ts | |
parent | 430878f6dd8d36b1322e15d0898ada0d44fecacb (diff) |
broke even
Diffstat (limited to 'src/server/database.ts')
-rw-r--r-- | src/server/database.ts | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/server/database.ts b/src/server/database.ts index 72ddbc82c..16211a2f6 100644 --- a/src/server/database.ts +++ b/src/server/database.ts @@ -9,7 +9,7 @@ export class Database { private MongoClient = mongodb.MongoClient; private url = 'mongodb://localhost:27017/Dash'; - public update(id: mongodb.ObjectID, value: any) { + public update(id: String, value: any) { this.MongoClient.connect(this.url, (err, db) => { let collection = db.db().collection('documents'); collection.update({ _id: id }, { $set: value }); @@ -33,7 +33,7 @@ export class Database { }); } - public getDocument(id: mongodb.ObjectID): string | undefined { + public getDocument(id: String): string | undefined { var result: JSON; this.MongoClient.connect(this.url, (err, db) => { if (err) { @@ -41,7 +41,7 @@ export class Database { return undefined } let collection = db.db().collection('documents'); - collection.findOne({ _id: Utils.GenerateDeterministicGuid(id.toHexString()) }, (err: any, res: any) => result = res) + collection.findOne({ _id: id }, (err: any, res: any) => result = res) console.log(result) db.close(); if (!result) { |