Get mongodb data into return data array?

#1

I have a list of checkboxes where I have inserted the state into the mongodb

like:

    "CheckboxState" : [ 
        "dust", 
        "candles"
    ]

Now I need to edit the checkbox list, but the problem is that I dont know howto add the “CheckboxState” content into

new Vue({
  el: '#app',
  data () {
    return {
      selected: [DATA FROM DB,'candles']
      
      
    }
  },

#2

Assuming your DATA FROM DB in that data property is an array itself, you can spread that data.

new Vue({
  el: '#app',
  data () {
    return {
      selected: [...DATA FROM DB,'candles']
    }
  },

Notice the … syntax? That’s the Spread Syntax in ES6.