Wednesday 20 March 2019

Question! mongodb shema validation on node.js api

Hi I've a problem I need to validate my form values at api before to save data to the database​​https://i.redd.it/hz6s38clsan21.jpgI have a from like this​const postSchema = mongoose.Schema({ name: { type: String, require: true }, lastname: { type: String, require: true }, il: { type: String, require: true }, ilce: { type: String, require: true }, }) here my mongoose schema​I already made form validation but I also need API validation​modulesvar express = require('express'); var path = require('path'); var bodyParser = require('body-parser'); const mongoose = require('mongoose') ​

Submitted March 20, 2019 at 04:11PM by teriologia

No comments:

Post a Comment