javascript - Error with java script while retrieving documents from mongodb -
basically idea documents calling function mongodb using javascript (not node.js)
var mongo = require('mongodb'); mongo.mongoclient.connect('mongodb://localhost:27017/database',function(err,db) { var result = []; result = db.eval('getcontacts("_id")',function(error, result) { console.log("error is:" +error); console.log("result is:"+result); console.log("working till here"); }) // db.close(); });
note: getconatcts db function contact related details.
error: error is:null result is: working till here
Comments
Post a Comment