You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Mongoose Node.JS ORM
Hello,
I can't seem to connect to MongoDB. So to create a connection I'm
running:
var mongoose = require('mongoose').Mongoose,
db = mongoose.connect('mongodb://localhost/db');
And I keep getting back:
TypeError: Object function Mongoose() {
this.connections = [];
this.plugins = [];
this.models = {};
this.modelSchemas = {};
this.options = {};
this.createConnection(); // default connection
} has no method 'connect'
at [object Context]:1:25
at Interface.<anonymous> (repl.js:144:22)
at Interface.emit (events.js:42:17)
at Interface._onLine (readline.js:132:10)
at Interface._line (readline.js:387:8)
at Interface._ttyWrite (readline.js:564:14)
at ReadStream.<anonymous> (readline.js:52:12)
at ReadStream.emit (events.js:59:20)
at ReadStream._emitKey (tty_posix.js:280:10)
at ReadStream.onData (tty_posix.js:43:12)
Perhaps my url is incorrect or Mongoose is not configured properly.
I have installed everything via npm and am running osx 10.6. Any
insight would greatly be appreciated.
James
Darrell Banks
unread,
Feb 8, 2011, 6:55:28 PM2/8/11
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to mongoo...@googlegroups.com
The latest version doesn't require you to use ('mongoose').Mongoose. Just use require('mongoose')