Skip to content

Instantly share code, notes, and snippets.

Created October 8, 2017 17:16
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
var express = require('express');
var User = require('../model/user');
var mongoose = require('mongoose');
var router = express.Router();'/insertUser', function(req, res, next) {
var newUser = new User(req.body);
newUser._id = mongoose.Types.ObjectId(); {
if (err) {
console.log("not saved!");
res.send({ id : newUser._id });
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment