From 3ae8b81da48a266dd5d513ec017689e91b0c9be3 Mon Sep 17 00:00:00 2001 From: k8w Date: Sat, 26 Feb 2022 11:32:37 +0800 Subject: [PATCH] mongodb crud --- examples/mongodb-crud/backend/src/api/ApiUpdatePost.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/mongodb-crud/backend/src/api/ApiUpdatePost.ts b/examples/mongodb-crud/backend/src/api/ApiUpdatePost.ts index dcb6af6..81b57cb 100644 --- a/examples/mongodb-crud/backend/src/api/ApiUpdatePost.ts +++ b/examples/mongodb-crud/backend/src/api/ApiUpdatePost.ts @@ -4,13 +4,13 @@ import { Global } from "../models/Global"; import { ReqUpdatePost, ResUpdatePost } from "../shared/protocols/PtlUpdatePost"; export async function ApiUpdatePost(call: ApiCall) { - let { _id, ...update } = call.req.update; + let { _id, ...rest } = call.req.update; let op = await Global.collection('Post').updateOne({ _id: _id }, { $set: { - ...update, + ...rest, update: { uid: 'xxx', time: new Date()