相关疑难解决方法(0)

Mongoose 模式在嵌套文档上设置时间戳

我有一个如下所示的架构:

{
  "_id": "5073c76a23ce3abf0f000001",
  "asker": {
    "userId": "fooId",
    "firstName": "foo",
    "lastName": "bar",
    "points": "10",
    "aboutMe": "Something about me"
  },
  "isBounty": false,
  "tags": ["mongodb", "nosql", "mongodb-query"],
  "title": "Is there merit to adding flat properties additional to a duplicate nested",
  "descriptionMd": "Question description",
  "offeredPoints": 10,
  "slug": "is-there-merit-to-adding-flat-properties-additional-to-a-duplicate-nested",
  "biddings": [{
    "biddingId": "_biddingId",
    "respondent": {
      "userId": "fooId",
      "firstName": "foo",
      "lastName": "bar",
      "points": "10",
      "aboutMe": "Something about me"
    },
    "biddingPoints": 10,
    "createdAt": "2019-03-21T08:00:00",
    "lastUpdatedAt": "2019-03-21T08:00:00"
  }],
  "acceptedBidding": "_biddingId",
  "answers": [
    {
      "respondent": {
        "address": { …
Run Code Online (Sandbox Code Playgroud)

mongoose mongodb

2
推荐指数
1
解决办法
1659
查看次数

标签 统计

mongodb ×1

mongoose ×1