问题
I'm trying to deploy my local node mongoDB app to Heroku. Everything is working fine on my local machine, no errors.
First thing I'm trying to do is to connect to a database on mlab. It seen very straight forward but I get this error:
err { MongoParseError: Incomplete key value pair for option
name: 'MongoParseError',
message: 'Incomplete key value pair for option',
[Symbol(mongoErrorContextSymbol)]: {} }
My code looks like this:
var mongoose = require('mongoose');
const options = {
useNewUrlParser: true
};
mongoose.connect("mongodb://username:password@xxxxx.mlab.com:39251/nameodDB",options).then(
()=>{
console.log("connected to mongoDB")},
(err)=>{
console.log("err",err);
});
来源:https://stackoverflow.com/questions/51352077/incomplete-key-value-pair-for-option-remote-mongodb