如何通过环回将我的表单数据存储在MongoDb中?

时间:2017-07-13 11:26:41

标签: arrays mongodb loopbackjs

以下是我要存储数据的格式: -

{
  "profilePicture": "string",
  "firstName": "string",
  "lastName": "string",
  "birthDate": "2017-07-13T10:41:30.618Z",
  "anniversary": "2017-07-13T10:41:30.618Z",
  "contact": [
    "string"
  ],
  "email": [
    "string"
  ],
  "webSite": [
    "string"
  ],
  "address": [
    "string"
  ],
  "location": {},
  "id": "string"
}

并且在我的控制器中,我给出了模型的格式如下: -

profile = { "location": {
    "type": "Point",
    "coordinates": [
      76,
      23
    ]
  },
  "webSite":[],
  "contact":[],
  "email":[],
  "address":[]
};

那么我如何使用post方法以上述格式存储数据呢?

0 个答案:

没有答案