Different syntax on mongodb module in Node.js -
i'm learning how use mongodb in node.js, long know, there 2 ways write code.
one (on books , online blogs):
var db = require('mongodb').db, connection = require('mongodb').connection, server = require('mongodb').server;
two (github page , documentation page on 10gen):
var mongoclient = require('mongodb').mongoclient;
why disparity occur , 1 should take if there differences other syntax? perhaps it's due different versions of module, if on number have take 1 on other?
thanks.
mongoclient
new prefered way all different drivers. has acknowledged (safe) writes on default , should general interface mongodb. see http://blog.mongodb.org/post/36666163412/introducing-mongoclient more information how , why.
Comments
Post a Comment