title: I can't save data to a Mongodb database MEAN Stack application
body: <p>so when I created a collection for user LOGIN/LOGOUT it worked perfectly fine I was able to get user data in and out of the database using Express app, mongoose and, but when I tried to create another collection it created the collection but doesn't save the data to MongoDB </p>
  
  <p>this is the component to save my data</p>
  
  <pre><code> @Component({
   selector: 'app-save-cv',
   templateUrl: './save-cv.component.html',
   styleUrls: ['./save-cv.component.css']
                })
  export class SaveCvComponent implements OnInit {
  
  form:FormGroup = new FormGroup({
  nom:new FormControl(null, Validators.required),
  prenom:new FormControl(null, Validators.required),
  adresse:new FormControl(null, Validators.required)
  })
  constructor(private _router:Router, private _cvService:CvService) { }
  
    save(){
      if(!this.form.valid ){
     console.log('Invalid Form'); return;
    }
   console.log(JSON.stringify(this.form.value));
  
  this._cvService.save(JSON.stringify(this.form.value))
  .subscribe(
    data=&gt; {console.log(data); this._router.navigate(['/register']);},
    error=&gt;console.error(error)
    )
   }
  
   ngOnInit() {
    }
  
  }
  </code></pre>
  
  <p>This is the Service i used to connect to my JAVA Script server APP.js</p>
  
  <pre><code>import { Injectable } from '@angular/core';
  import {HttpClient, HttpHeaders} from '@angular/common/http';
  
  @Injectable()
  export class CvService {
  
    constructor(private _http:HttpClient) { }
  
    save(body:any){
      return this._http.post('http://127.0.0.1:3000/cvs/save',body,{
        observe:'body',
        withCredentials:true,
        headers:new HttpHeaders().append('Content-Type','application/json')
      });}}
  </code></pre>
  
  <p>this is the route I used </p>
  
  <pre><code>var express = require('express');
  var router = express.Router();
  var Cv = require('../models/cv');
  var passport = require('passport');
  
  router.post('/save', function (req, res, next) {
   addToDB(req, res);
    });
  
    async function addToDB(req, res)  {
  
    var cv = new Cv({
     Nom : req.body.Nom,
     Prenom: req.body.Prenom,
     Adresse:req.body.Adresse
  
     });
  
  try {
    doc = await cv.save();
    return res.status(201).json(doc);
   }
   catch (err) {
     return res.status(501).json(err);
   }
  </code></pre>
  
  <p>}
       module.exports = router;</p>
  
  <p>this is my schema </p>
  
  <pre><code>var mongoose = require('mongoose');
  var Schema = mongoose.Schema;
  
  var schema = new Schema({
  Nom : {type:String, require:true},
  Prenom: {type:String, require:true},
  Adresse:{type:String, require:true}
  
    });
  
  
  
    module.exports = mongoose.model('Cv',schema);
  </code></pre>
  
  <p>i expected the data to be saved in the database but insted i only get </p>
  
  <pre><code> {_id: "5cdc472b8115fb260409dffe", __v: 0}
    __v: 0
    _id: "5cdc472b8115fb260409dffe"
    __proto__: Object}
  </code></pre>