Advertisement
Guest User

Untitled

a guest
Mar 13th, 2019
133
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. module.exports = {
  2.     startup: function(dbToUse) {
  3.         mongoose.connect(dbToUse);
  4.         mongoose.connection.on('open', function() {
  5.             console.log("MongoDB connection established.");
  6.         });
  7.     },
  8.  
  9.     saveUser: function(userInfo, callback) {
  10.         var newUser = new User({
  11.             displayName: userInfo.displayName
  12.         , email: userInfo.email
  13.         , password: userInfo.password
  14.         });
  15. }
  16.  
  17. // app.js
  18.  
  19. db = new DB.startup(conn);
  20.  
  21. db.saveUser()
  22.  
  23. TypeError: Object [object Object] has no method 'saveUser'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement