4

In this thread: Running mongod.exe from webstorm

it points that mongo4idea shall do the trick, however, mongo4idea is only replacing the mongo shell. It means that the mongod service should be up and running before we use the mongo4idea plugin.

Is there a way for WebStorm/IntelijIdea etc... to start the server automatically?

Currently I'm starting the server manually using: mongod --dbpath /some/path/to/data

Community
  • 1
  • 1
TBE
  • 1,002
  • 1
  • 11
  • 32
  • 3
    It's really not the job of code editor to run your database server. – Sergio Tulentsev Nov 08 '15 at 16:02
  • it knows how to start node.js and open a web browser tab automatically. Why shouldn't it start the DB Server as well? (for a more friendly developers environment) – TBE Nov 08 '15 at 16:14
  • 2
    Starting web server can be justified (it offers some debugging, after all, so it makes sense to run process in a controlled manner). But database - no. Should it also start memcached if your app uses it? Do you imagine the complexity this would bring? – Sergio Tulentsev Nov 08 '15 at 16:17
  • I am with Sergio here. But: OP might want to install Thomas Rückstieß' awesome mtools package, which contains [mlaunch](https://github.com/rueckstiess/mtools/wiki/mlaunch) for easy test setups, even sharded clusters can be set up locally with a single command. – Markus W Mahlberg Nov 08 '15 at 18:45
  • @TomerBenEzra Please note that on Stack Overflow, it is customary to **upvote** the answers that have helped you (besides marking them as accepted). – Dmytro Shevchenko Nov 12 '15 at 09:47
  • @Dmytro Shevchenko i upvoted it immediately, but i have only 12 reputation so far, so until i'll reach 15 reputation, my votes are not displayed. Same goes for the answer you just answered at my thread regarding mongoDB's auto increment. – TBE Nov 12 '15 at 09:53
  • @TomerBenEzra you now have 27 reputation :) So the upvotes will probably appear soon. – Dmytro Shevchenko Nov 12 '15 at 09:56

1 Answers1

5

You can easily do this using External tools (Settings/Tools/External Tools), add a new tool, specify path/to/mongod as a 'Program', --dbpath /some/path/to/data - as 'Parameters', choose menus you's like to add this action to in 'Show in' section. Note that you can also assign a shortcut to your tool in Settings/Keymap/External Tools/External Tools/<your tool name>

lena
  • 90,154
  • 11
  • 145
  • 150