title: can't insert data using mongoose
body: <p>i am new in mean stack i completed update,delete,and get data but can't insert data in mongoose can anyone help me please.thanks in advance below is my code.</p>
  
  <pre><code>var express = require('express');
  var mongojs = require('mongojs');
  var db = require('mongoose');
  var bodyParser = require('body-parser');
  
  var app = express();
  app.use(express.static(__dirname + "/public"));
  app.use(bodyParser.json());
  db.connect('mongodb://localhost/contactlist');
  var db1 = db.connection;
  db1.on('error', err);
  db1.once('open',startserver);
  function err(){
  console.log('connection error:');
  }
  function startserver(){
  console.log('start');
  app.listen(3000);
  }
  var contactdetails1 = new db.Schema({
      name:String,
      email:String,
      password:String,
      number:String  
  });
  db1.model('Contactdetails',contactdetails1);
  
  app.post('/contactList',function(req,res){
    console.log("Get insert request"+req.body);
  //var contactList = new ContactList(req.body);
    var contactdetails1 = new db.Schema({
     name:req.body.name,
      email:req.body.email,
      password:'',
      number:req.body.number        
      });
  
  
    contactdetails1.save(function(err,data) {
          if (err) {
              response = {
                  "status":0,
                  "error":err,
              };
          }else{
              response = {
                  "status":1,
                  "data":data,
                  "message":"User registered successfully"
              };
          }
          console.log(response);
          res.json(response);   
      });       
  });
  </code></pre>
  
  <p>when inserting data at that time below error show </p>
  
  <p>Undefined type <code>Test</code> at <code>name</code>
    Did you try nesting Schemas? You can only nest using refs or arrays.
      at Function.Schema.interpretAsType (/usr/lib/node_modules/mongoose/lib/schema.js:666:11)
      at Schema.path (/usr/lib/node_modules/mongoose/lib/schema.js:545:29)
      at Schema.add (/usr/lib/node_modules/mongoose/lib/schema.js:429:12)
      at new Schema (/usr/lib/node_modules/mongoose/lib/schema.js:100:10)
      at /var/www/html/contactlistappmvc/server.js:53:25</p>