S
S
shane892016-02-13 00:45:46
MongoDB
shane89, 2016-02-13 00:45:46

How does mongodb work?

Hi. For the application, I decided to use mongodb. Haven't worked with nosql yet, but I seem to have figured it out. Now I want to understand one thing. I installed mongodb i.e. server. Question. When requesting a collection, the mongodb server is already running, or starts when the nodejs server starts up for example. And mongodb is installed in sys. files? If you install it in the project directory or it does not matter where and how mongodb was installed. Now for storing collections, the collections folder can be anywhere or in the mongodb folder. If in any, then how can I specify the folder with the collections, through mongod? Can you elaborate

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Stanislav Makarov, 2016-02-13
@Nipheris

When requesting a collection, the mongodb server is already running, or starts when the nodejs server starts up for example.

It seems that you have not worked not only with nosql, but in general with any multi-user DBMS. Monga is not SQLite: a daemon starts and listens on a port for network connections.
I didn't understand the question at all. What do you mean by "system files"?
I think you shouldn't install it in the project directory.
Well, it seems to be yes, in any normal client-server DBMS, the directory for the data is configured.
In general, read something from here https://ru.wikipedia.org/wiki/%D0%9A%D0%BB%D0%B8%D... , you need to understand that a monga with its data lives on its own , and your application is on its own, and they communicate using TCP. Therefore, there is no point in somehow linking the directory to the project and the directory to the Mongi database, because they can be on completely different machines.

A
Andrey, 2016-02-13
@VladimirAndreev

the server usually starts when the system boots.
Well, you can build it into the project directory from the sources, yes.
override data directory? most likely in the config file

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question