最新的数据记录器mongoDB

时间:2019-01-02 14:25:41

标签: angular mongodb mongodb-query

我只希望后端每次进行更新时,记录日期都可以像date.now一样,位于updatedAt字段中

我已经尝试在更新时将Date.now发送到UpdatedAt字段,但这不起作用,因为它不能理解为命令,而可以理解为字符串

{
        "_id": "5c2cc5198681841f4c8421c4",
        "iplocal": "172.16.0.15",
        "ippublico": "181.123.218.39",
        "uptime": "4 days,",
        "mac": "18:d6:c7:af:b1:39",
        "__v": 0,
        "updatedAt": "2019-01-02T14:05:13.506Z", -- > This is the field I want that records the date when and made an update the modification
    }

0 个答案:

没有答案