Nested objects with arrays
See original GitHub issueDoes the current validation process include handling the arrays ? I have nested user input similar to this (request body):
{ "person": { "name": "Mike", "emails": [ "aadsa@dsad", "a@a.com" ] } }
So using such validation rule should apply on the each array element, currently its not working such way:
req.checkBody('person.emails').isEmail()
Issue Analytics
- State:
- Created 9 years ago
- Comments:7 (2 by maintainers)
Top Results From Across the Web
How can I access and process nested objects, arrays, or JSON?
A nested data structure is an array or object which refers to other arrays or objects, i.e. its values are arrays or objects....
Read more >How does Nested Array work in JavaScript? - eduCBA
Nested Array in JavaScript is defined as Array (Outer array) within another array (inner array). An Array can have one or more inner...
Read more >Group objects inside the nested array JavaScript - Tutorialspoint
Group objects inside the nested array JavaScript - Let's say e have a parentArray that contains many sub arrays each of the same...
Read more >Nested JavaScript Objects and Arrays. - W3Schools Tryit Editor
Nested JavaScript Objects and Arrays. Ford. Fiesta Focus Mustang. BMW. 320. X3 X5. Fiat. 500. Panda.
Read more >Nested Objects and Arrays - VeeValidate
Similar to objects, you can also nest your values in an array, using square brackets just like how you would do it in...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
It’s possible, @LogansUA. You just have to make use of wildcards. As per the OP’s example, this would be
person.emails.*
.This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.