에 원격 몽고 서버에 다음과 같은 삽입 내가 로컬를 을 실행할 때 않는 몽고에 삽입 할 수 없습니다,하지만 난 내 appfog 서버에서 실행할 때 삽입하지 않습니다.노드 + 몽고는 몇 가지 이유를 들어 로컬 호스트
function record_visit(req, res){
res.write("<br/>Connecting to "+mongourl+"<br/>");
mongo.connect(mongourl, function(err, conn){
res.write("<br/>mongo.connect success. Err = "+err+"<br/>");
conn.collection('ips', function(err, coll){
res.write("<br/>conn.collection called on collection ips, err = "+err+"<br/>");
object_to_insert = { 'ip': req.connection.remoteAddress, 'ts': new Date() };
coll.insert(object_to_insert, {safe:true}, function(err){
res.write("Inserted in collection 'ips' Err= "+err);
res.end('<br/>Done\n');
});
});
});
}
내 출력은 다음과 같습니다
Connecting to [correct authenticated url to mongo here]
mongo.connect success. Err = null
conn.collection called on collection ips, err = null
Inserted in collection 'ips' Err= null
Done
내가 어딘가에 몇 가지 권한을 지정해야합니까?