how to access various mongo databases with node

49 görüntüleme
İlk okunmamış mesaja atla

Roland Bole

okunmadı,
25 May 2015 08:47:3625.05.2015
alıcı nod...@googlegroups.com

I need some guideline with this question.

I try to build an node express REST api which has to deal with various mongoDB databases on the same mongoDB server.

What is the right approach to do this?

The sequence could be:

  • app starts
  • connect to the mongoDB Server
  • use the right express route
  • check which database is needed
  • finally query the correct data
  • connection to the database is still open

OR

  • use the right express route
  • connect to the mongoDB Server
  • check which database is needed
  • query the data
  • close the DB connection

AND how can I do this with mongo-native driver, not mongoose?

Thanks for any help.

Oleg Verych

okunmadı,
26 May 2015 08:23:0726.05.2015
alıcı nod...@googlegroups.com
Hi, Roland

I need some guideline with this question.

I try to build an node express REST api which has to deal with various mongoDB databases on the same mongoDB server.

What is the right approach to do this?

[...]

AND how can I do this with mongo-native driver, not mongoose?

Abramovick

okunmadı,
26 May 2015 15:42:5826.05.2015
alıcı nod...@googlegroups.com
The best native mongodb driver wrapper i've been using would be mongojs. https://github.com/mafintosh/mongojs
Tutorials on how to use it in relation to the bullet point you raised: http://howtonode.org/node-js-and-mongodb-getting-started-with-mongojs
Tümünü yanıtla
Yazarı yanıtla
Yönlendir
0 yeni ileti