node.js - How to create DB users in mongodb using mongoose -


i can create users mongo shell using createuser() function. have requirement need create users gui(using nodej,express).im using mongoose multiple connections db. cant see functions in mongoose. there functions or packages supports features createuser, delete user this.

connect using db = mongoose.mongo.mongoclient('mongodb://'+username+':'+passwor‌​d+'@localhost/dbtoco‌​nnect, function(err, db){});

using db object admin access first. can use admin collection , authenticate using admin username , password using admin_db.authenticate('adminusername', 'password'); using adduser function can add users


Comments

Popular posts from this blog

matlab - error with cyclic autocorrelation function -

django - (fields.E300) Field defines a relation with model 'AbstractEmailUser' which is either not installed, or is abstract -

c# - What is a good .Net RefEdit control to use with ExcelDna? -