MongoDB: Difference between revisions

From NixOS Wiki
Tboston (talk | contribs)
Initial mongodb article
 
m fix typo in the link displayname
 
(2 intermediate revisions by 2 users not shown)
Line 1: Line 1:
[[wikipedia:MongoDB|MondoDB]] is a NoSQL database program.  
[[wikipedia:MongoDB|MongoDB]] is a NoSQL database program.  


== Installation ==
== Installation ==
Line 9: Line 9:


== Configuration ==
== Configuration ==
Here's an example with multiple options. Beware that putting your password in <syntaxhighlight lang="nix">
Here's an example with multiple options. Beware that putting your password in cleartext into the config should not be done. Please check [[Comparison of secret managing schemes]] for that matter. <syntaxhighlight lang="nix">
services.mongodb = {
services.mongodb = {
   enable = true;
   enable = true;
Line 18: Line 18:
};
};
</syntaxhighlight>
</syntaxhighlight>
[[Category:Server]]
[[Category:Database]]

Latest revision as of 17:14, 16 September 2024

MongoDB is a NoSQL database program.

Installation

If no extra configuration is needed, you'll only use the following line to install and enable MongoDB. This will give you a mongodb with authentication disabled, listening on 127.0.0.1 and the database path to store the data is /var/db/mongodb.

...
services.mongodb.enable = true;
...

Configuration

Here's an example with multiple options. Beware that putting your password in cleartext into the config should not be done. Please check Comparison of secret managing schemes for that matter.

services.mongodb = {
  enable = true;
  package = "mongodb-5_0";
  enableAuth = true;
  initialRootPassword = "YourSecurePassword";
  bind_ip = "10.5.0.2";
};