Joby Wilson Mathews
Joby Wilson Mathews

Reputation: 11116

How to run mongo script automatically after MongoDB server start?

I am trying to run couple of Mongo scripts automatically after MongoDB server start.

I tried looking into various options in mongod.conf , but did'nt find any solution.

Could you please help me.

Software used:

MongoDB Community version 4.0.8

Windows 7 64 bit

Upvotes: 0

Views: 1086

Answers (1)

Tom Slabbaert
Tom Slabbaert

Reputation: 22276

Unfortunately MongoDB does not have any support for triggers.
As other people have commented if you have a certain schedule you can work around that.

You can also try and use other services like Mongo Stich where there's no real trigger like server restart but you can work around it with binding a trigger to an event like first insert or first login.

Upvotes: 1

Related Questions