从数组节点提取所有对象值

我有一个包含对象的数组,它们是值。

Is it possible to extract all object values without doing this every time: Array[objnumber].value?

Here is how it looks in mongoDB:https://gyazo.com/a4a6702ef0546609ea231de299ee62fd

这是数据的样子

{
   "date":[
      {
         "title":"Unavaible",
         "start":"2020-05-19",
         "end":"2020-05-22"
      },
      {
         "title":"Unavaible",
         "start":"2020-05-28",
         "end":"2020-05-29"
      },
      {
         "title":"Unavaible",
         "start":"2020-05-29",
         "end":"2020-05-31"
      }
   ]
}
评论
Jane
Jane

我只是使用JSON.stringify来完成它。

码:

const responses = response.data.date
        const stringify = JSON.stringify(responses);
        this.setState({
          undates:[stringify]
        });

点赞
评论