0

I am new in moleculer framework. I want to store the data in mongoDB which received from moleculer framework.

In sort i want to MongoDB instead of moleculer-db it is possible ?

Please help me. Thanks.

Mayur Vaghasiya
  • 1,383
  • 2
  • 12
  • 24
  • What do you mean by "connect"? Moleculer seems to be a Node framework, so the MongoDB Node driver would be the place to start: https://docs.mongodb.com/drivers/node/current/. Seems like you might mean something more, though - can you give us more details? – James Clover Jun 02 '21 at 05:37
  • "connect" means I want store moleculer framework data in mongoDB instead off "moleculer-db" – Mayur Vaghasiya Jun 02 '21 at 05:54

1 Answers1

2

If you don't want to use moleculer-db then you need to write the connection logic and the actions yourself. In order to establish the connection with the DB you need to use lifecycle events. Take a look at this example. Instead of DB connection it creates an HTTP server but the logic is the same. After that, just write your actions

André Mazayev
  • 393
  • 2
  • 10