diff options
| author | syuilo <syuilotan@yahoo.co.jp> | 2018-10-16 11:38:09 +0900 |
|---|---|---|
| committer | syuilo <syuilotan@yahoo.co.jp> | 2018-10-16 11:38:09 +0900 |
| commit | 9427a756c9e4a1d95210ccfca56fdb67d62183ec (patch) | |
| tree | 667cf5f4d6ecf80d0e3a22c4085a410537d1dc9d /src/models/note-watching.ts | |
| parent | fix(package): update @types/node to version 10.12.0 (#2912) (diff) | |
| download | misskey-9427a756c9e4a1d95210ccfca56fdb67d62183ec.tar.gz misskey-9427a756c9e4a1d95210ccfca56fdb67d62183ec.tar.bz2 misskey-9427a756c9e4a1d95210ccfca56fdb67d62183ec.zip | |
Update mongodb
Diffstat (limited to 'src/models/note-watching.ts')
| -rw-r--r-- | src/models/note-watching.ts | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/models/note-watching.ts b/src/models/note-watching.ts index 479f92dd44..ae576907bc 100644 --- a/src/models/note-watching.ts +++ b/src/models/note-watching.ts @@ -1,5 +1,6 @@ import * as mongo from 'mongodb'; import db from '../db/mongodb'; +import isObjectId from '../misc/is-objectid'; const NoteWatching = db.get<INoteWatching>('noteWatching'); NoteWatching.createIndex(['userId', 'noteId'], { unique: true }); @@ -19,7 +20,7 @@ export async function deleteNoteWatching(noteWatching: string | mongo.ObjectID | let n: INoteWatching; // Populate - if (mongo.ObjectID.prototype.isPrototypeOf(noteWatching)) { + if (isObjectId(noteWatching)) { n = await NoteWatching.findOne({ _id: noteWatching }); |