Node JS get request body length
<p>I need to get the length of a field in req.body. But using <code>req.body.username.length &lt;= 5</code> I got error <code>Cannot read property 'length' of undefined</code>. How can I do it?</p>