Do the variables username or password contain spaces, colons, slashes or other special characters? If so they need to be percent-encoded for use in a URL.
On Dec 7, 2012, at 18:42, man12 wrote: > Space is not there. That's just a typo on my part. > > On Friday, December 7, 2012 4:35:34 PM UTC-6, Daniel R. wrote: >> Remove the space before the @ sign in your address variable. >> >> -- Daniel R. <[email protected]> [http://danielr.neophi.com/] >> >> >> On Fri, Dec 7, 2012 at 2:40 PM, man12 <[email protected]> wrote: >>> var mongoose = require('mongoose'); >>> var Schema = mongoose.Schema; >>> >>> module.exports.mongoose = mongoose; >>> module.exports.Schema = Schema; >>> >>> // Connect to cloud database >>> var username = "myusername"; >>> var password = "mypassword"; >>> var address = ' @ds045147.mongolab.com:45147/mydatabasename'; >>> connect(); >>> >>> // Connect to mongo >>> function connect() { >>> var url = 'mongodb://' + username + ':' + password + address; >>> mongoose.connect(url); >>> } >>> >>> function disconnect() { mongoose.disconnect(); } -- Job Board: http://jobs.nodejs.org/ Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines You received this message because you are subscribed to the Google Groups "nodejs" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/nodejs?hl=en?hl=en
