express-mongo-db icon indicating copy to clipboard operation
express-mongo-db copied to clipboard

Request - Example

Open astrotars opened this issue 6 years ago • 3 comments

Can you please provide an example of how to call req.db properly? (e.g. req.db.collection.find({})); Everything I've tried returns an error that find is not a function.

astrotars avatar Jan 08 '19 07:01 astrotars

Hi

` req.db.collection("users").find().toArray(function(err, getUsers){ console.log(getUsers) });

`

payamomrani avatar Mar 20 '20 13:03 payamomrani

Hi, in my case req.db returns the default database "admin". How can I specify the name of the database I want to be used? Thanks.

vladi-strilets avatar Apr 05 '20 01:04 vladi-strilets

Hi, in my case req.db returns the default database "admin". How can I specify the name of the database I want to be used? Thanks.

Having the same problem as above even though I have specified a default db in my connection string... :(

michel-fresh avatar Aug 07 '20 00:08 michel-fresh