Update mongodb
This commit is contained in:
@ -3,6 +3,7 @@ const deepcopy = require('deepcopy');
|
||||
import { pack as packFolder } from './drive-folder';
|
||||
import config from '../config';
|
||||
import monkDb, { nativeDbConn } from '../db/mongodb';
|
||||
import isObjectId from '../misc/is-objectid';
|
||||
import Note, { deleteNote } from './note';
|
||||
import MessagingMessage, { deleteMessagingMessage } from './messaging-message';
|
||||
import User from './user';
|
||||
@ -78,7 +79,7 @@ export async function deleteDriveFile(driveFile: string | mongo.ObjectID | IDriv
|
||||
let d: IDriveFile;
|
||||
|
||||
// Populate
|
||||
if (mongo.ObjectID.prototype.isPrototypeOf(driveFile)) {
|
||||
if (isObjectId(driveFile)) {
|
||||
d = await DriveFile.findOne({
|
||||
_id: driveFile
|
||||
});
|
||||
@ -154,7 +155,7 @@ export const pack = (
|
||||
let _file: any;
|
||||
|
||||
// Populate the file if 'file' is ID
|
||||
if (mongo.ObjectID.prototype.isPrototypeOf(file)) {
|
||||
if (isObjectId(file)) {
|
||||
_file = await DriveFile.findOne({
|
||||
_id: file
|
||||
});
|
||||
|
Reference in New Issue
Block a user