Instalación

sudo apt-get install gnupg wget -qO - https://www.mongodb.org/static/pgp/server-4.4.asc | sudo apt-key add - echo "deb http://repo.mongodb.org/apt/debian buster/mongodb-org/4.4 main" | sudo tee /etc/apt/sources.list.d/mongodb-org-4.4.list sudo apt-get update sudo apt-get install -y mongodb-org

Por defecto las instancias de MongoDB almacenan:

los archivos de datos en /var/lib/mongodb

los archivos de logs en /var/log/mongodb

sudo systemctl daemon-reload sudo systemctl enable mongod sudo systemctl start mongod sudo systemctl status mongod

Uso

mongodb >help >show dbs >show collections >db.getCollection("test").find({}); >db.users.insert({_id:1, name:"Sarah C."}) // _id : 1 >db.users.insert({_id:2, name:"Bob D."}) // _id : 2 >db.getCollection("users").find({}); mongoimport --db test --collection docs --file example2.json

Referencias

https://docs.mongodb.com/manual/tutorial/install-mongodb-on-debian/

https://docs.mongodb.com/manual/core/views/

https://studio3t.com/academy/lessons/query-mongodb-with-sql-select-statements/

https://docs.mongodb.com/manual/reference/method/db.collection.insert/

https://docs.mongodb.com/manual/tutorial/model-embedded-one-to-many-relationships-between-documents/