MongoDB OptionalId<xxx>
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { Collection, Db, MongoClient } from "mongodb";
|
||||
import { Collection, Db, MongoClient, OptionalId } from "mongodb";
|
||||
import { Logger } from "tsrpc";
|
||||
import { DbPost } from "../shared/db/DbPost";
|
||||
import { BackConfig } from "./BackConfig";
|
||||
@@ -14,7 +14,7 @@ export class Global {
|
||||
this.db = client.db();
|
||||
}
|
||||
|
||||
static collection<T extends keyof DbCollectionType>(col: T): Collection<DbCollectionType[T]> {
|
||||
static collection<T extends keyof DbCollectionType>(col: T): Collection<OptionalId<DbCollectionType[T]>> {
|
||||
return this.db.collection(col);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user