Answer the question
In order to leave comments, you need to log in
How to output data from MongoDB to textarea?
I work on node.js with Mongodb, outputting data to the console is good. To output to the console, I write:
var findClient = function(db, callback) {
var cursor =db.collection('client').find( );
cursor.each(function(err, doc) {
assert.equal(err, null);
if (doc != null) {
console.log(doc);
} else {
callback();
}
});
};
MongoClient.connect(url, function(err, db) {
assert.equal(null, err);
findClient(db, function() {
db.close();
});
});
Tell me how you can output data from MongoDB to a textarea or another HTML field/element.
tried via document.getElementById('output').value =doc; does not exceed.
Answer the question
In order to leave comments, you need to log in
document.getElementById('output').value =doc;
where did you write this code?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question