title: How to receive the entire object of req.body.model instead of all variables of it separately in Node.JS?
body: <p>I  have an example form with two elements, name and surname from model user</p>
  
  <pre><code>form(action="/user/create", method="post")
      label(for="name") Name
      input(type="text", id="name", name="name", value="", autofocus)
  
      label(for="surname") Surname
      input(type="text", id="surname", name="surname", value="")
  </code></pre>
  
  <p>When I'm posting it I send an object in the request body </p>
  
  <pre><code>{
      "name": "[value input name]", 
      "surname": "[value input surname]"
  }
  </code></pre>
  
  <p>For this reason, in my node js server I get this model values for validate it with this:</p>
  
  <pre><code>{
      name: req.body.name,
      surname: req.body.surname
  }
  </code></pre>
  
  <p>But I want to get all model info as object</p>
  
  <pre><code>form(action="/user/create", method="post")
      label(for="name") Name
      input(type="text", id="name", name="user.name", value="", autofocus)
      br
      label(for="surname") Surname
      input(type="text", id="surname", name="user.surname", value="")
  </code></pre>
  
  <p>And get it as:</p>
  
  <pre><code>req.body.user
  </code></pre>
  
  <p>But it returns me undefined. When I read req.body is:</p>
  
  <pre><code>{
      "user.name": "[value input name]",
      "user.username": "[value input surname]"
  }
  </code></pre>
  
  <p>I want to get something as:</p>
  
  <pre><code>{
      "user": {
          "name":"[value input name]",
          "surname":"[value input surname]"
      }
  }
  </code></pre>