title: How to insert data of a single form into two collections using nodejs and mongodb
body: <p>how do i insert the first three data coming from req.body into event collection and rest into personal collection</p>
  <pre><code>app.post(&quot;/api/bookings&quot;, async(req, res) =&gt; {
            const {
              eventName,
              date,
              venue,
              firstname,
              lastname,
              email,
              contact,
              address1,
              address2,
              city,
              state,
              zip,
            } = req.body;
  
            try {
              await new Event(req.body).save();
              await new Personal(req.body).save()
              console.log(&quot;inserted&quot;);
            } catch (error) {
              console.log(error);
            } 
  })
  </code></pre>