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

Popular posts from this blog

python - jinja2: TemplateSyntaxError: expected token ',', got 'string' -

node.js - NodeJS remote terminal to Dropbear OpenWRT-Server -

Qt4: how to send QString inside a struct via QSharedMemory -