question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Express-Validator Check array of Subdocuments

See original GitHub issue

This is my Schema:

const InvoiceSchema = new Schema({
name: { type: String, required: true },
description: { type: String },

items: [{
    name: { type: String, required: true },
    rate: { type: Number, required: true },
    quantity: { type: Number, required:true, default: 1 },
    amount: { type: Number }
}]});

I want to know if there is a way to use Express-validator to check items elements?

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

3reactions
gustavohenkecommented, May 25, 2017

If someone implements it properly before I have a chance, then yes.

2reactions
gustavohenkecommented, Aug 27, 2017

Hello folks, v4.0.0 has finally been released, bringing with it the long awaited wildcard * support! 🎉

Please check the README for complete docs, and also check the upgrade guide.

Read more comments on GitHub >

github_iconTop Results From Across the Web

node.js - Express-Validator Check array of Subdocuments
I want to know how to use Express-validator to check items elements? node.js · validation · express · mongoose · mongoose-schema · Share....
Read more >
Wildcards - express-validator
Sometimes you will want to apply the same rules to all items of an array or all keys of some object. That's what...
Read more >
Mongoose v6.8.1: SubDocuments
Each subdocument has an _id by default. Mongoose document arrays have a special id method for searching a document array to find a...
Read more >
Mongoose 101: Working with subdocuments
The easiest way to update subdocuments is: Use findOne to find the document; Get the array; Change the array; Run save. For example,...
Read more >
Update Arrays in a Document — Node.js
In this guide, you can learn how to use the following array update operators to modify an array embedded within a document: Positional...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found