0

(node:2820) DeprecationWarning: Mongoose: mpromise (mongoose's default promise library) is deprecated, plug in your own promise library instead: http://mongoosejs.com/docs/promises.html

I am having this issue mongoose.Promise = global.Promise; is not working for me

Neil Lunn
  • 148,042
  • 36
  • 346
  • 317
  • Not working how exactly? You need to show the code that is actually causing the problem. – Neil Lunn Sep 14 '17 at 07:25
  • var mongoose = require("mongoose"); mongoose.connect("mongodb://localhost/blog_demo", { useMongoClient: true, }); // USERS SCHEMA name,email var userSchema = new mongoose.Schema({ email: String, name: String }); var User = mongoose.model("User", userSchema); var newUser = new User({ email: "charlie@brown.edu", name: "Charlie Brown" }); newUser.save(function(err, user){ if(err){ console.log(err); } else{ console.log(user); } }); – Rija Lodhi Sep 14 '17 at 07:28
  • That was actually a prompt for you to edit the code in your question instead of trying to post it in a comment, as well as actually explaining what the problem is. So is the problem just the deprecation warning? Or is is actually that your code is doing nothing and hanging there? Because the latter is actually a different problem than what you think it is. – Neil Lunn Sep 14 '17 at 07:31

0 Answers0