From 3f4082593e983bf5d06b2fb8bc671bc602f9f7cf Mon Sep 17 00:00:00 2001 From: k8w Date: Wed, 12 Jan 2022 15:37:53 +0800 Subject: [PATCH] MongoDB OptionalId --- examples/mongodb-crud/backend/src/models/Global.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/mongodb-crud/backend/src/models/Global.ts b/examples/mongodb-crud/backend/src/models/Global.ts index 7804839..d86f33a 100644 --- a/examples/mongodb-crud/backend/src/models/Global.ts +++ b/examples/mongodb-crud/backend/src/models/Global.ts @@ -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(col: T): Collection { + static collection(col: T): Collection> { return this.db.collection(col); }