title: Conversion of Array and objects to bulk insert in mysql Sequelize + Nodejs
body: <p>This is my json object:</p>
  
  <pre><code>    {
      "groups":
  
   [
          {
              "id": 1,
              "groupname": "Angular",
              "createdAt": "2017-12-05T09:36:05.000Z",
              "updatedAt": "2017-12-05T09:36:05.000Z",
              "contactgroups": [
              {
                  "id": 1,
                  "contact":
                  {
                      "gsm": "12345"
                  }
              },
              {
                  "id": 3,
                  "contact":
                  {
                      "gsm": "54321"
                  }
              },
              {
                  "id": 4,
                  "contact":
                  {
                      "gsm": "99999"
                  }
              }],
              "select": true
          },
          {
              "id": 2,
              "groupname": "React",
              "createdAt": "2017-12-05T09:36:10.000Z",
              "updatedAt": "2017-12-05T09:36:10.000Z",
              "contactgroups": [
              {
                  "id": 2,
                  "contact":
                  {
                      "gsm": "66666"
                  }
              },
              {
                  "id": 5,
                  "contact":
                  {
                      "gsm": "54321"
                  }
              }],
              "select": true
          },
          {
              "id": 3,
              "groupname": "Vue",
              "createdAt": "2017-12-05T09:36:15.000Z",
              "updatedAt": "2017-12-05T09:36:15.000Z",
              "contactgroups": [
              {
                  "id": 6,
                  "contact":
                  {
                      "gsm": "12345"
                  }
              }]
          },
       ],
      "sender": "ifelse",
      "message": "test"
  }
  </code></pre>
  
  <p>I want to convert above object like this:</p>
  
  <pre><code>[
      {"gsm": 12345, "sender": "ifelse", "message": "test"},
      {"gsm": 54321, "sender": "ifelse", "message": "test"},
      {"gsm": 99999, "sender": "ifelse", "message": "test"},
      {"gsm": 66666, "sender": "ifelse", "message": "test"},
      {"gsm": 54321, "sender": "ifelse", "message": "test"},
      {"gsm": 12345, "sender": "ifelse", "message": "test"},
  
  ]
  </code></pre>
  
  <p>Then only i am able to bulk insert in sequelize.</p>
  
  <p>How to do this using for or foreach or any other functions? to done this stuff?</p>
  
  <p>is foreach better? is it possible to do with map?</p>
  
  <p>I want my final json object, then only sequelize allowed to bulk create.</p>
  
  <p>Ps: I want "select": true json gsm numbers only</p>