Difference between revisions of "MongoDB"
Jump to navigation
Jump to search
Tags: Mobile web edit, Mobile edit |
|||
(33 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
− | [[wikipedia:MongoDB]] (2009) is an open-source [[document-oriented database]] using a [[JSON]]-like documents with [[schema]]. Listen by default on [[port]] TCP 27017. | + | [[wikipedia:MongoDB]] (Feb [[2009]]) is an open-source [[document-oriented database]] using a [[JSON]]-like documents with [[schema]]. Listen by default on [[port]] TCP 27017. |
− | * Installation: <code>[[brew tap]] mongodb/brew && brew install mongodb-community</code> | + | * Installation: <code>[[brew tap]] mongodb/brew && [[brew install]] mongodb-community</code> |
* Runnig manually: <code>mongod --config /usr/local/etc/[[mongod.conf]] --fork</code> | * Runnig manually: <code>mongod --config /usr/local/etc/[[mongod.conf]] --fork</code> | ||
+ | * <code>[[/var/log/mongodb/mongodb.log]]</code> | ||
+ | * <code>[[/var/lib/mongodb/]]</code> | ||
== Features == | == Features == | ||
Line 13: | Line 15: | ||
* Aggregation | * Aggregation | ||
* Server-side JavaScript execution | * Server-side JavaScript execution | ||
− | * Capped collections | + | * Capped [[collections]] |
* [[ACID]] transactions | * [[ACID]] transactions | ||
== Binaries == | == Binaries == | ||
+ | * <code>[[mongo]]</code> MongoDB shell | ||
* <code>[[mongodb]]</code> | * <code>[[mongodb]]</code> | ||
* <code>[[mongos]]</code> MongoDB Sharded Cluster Query Router | * <code>[[mongos]]</code> MongoDB Sharded Cluster Query Router | ||
Line 24: | Line 27: | ||
* <code>[[mongoexport]]</code> | * <code>[[mongoexport]]</code> | ||
* <code>[[mongoimport]]</code> | * <code>[[mongoimport]]</code> | ||
+ | * [[mongoreplay]] | ||
+ | * [[mongostat]] | ||
+ | * [[mongoperf]] | ||
== Editions == | == Editions == | ||
* MongoDB Community Server | * MongoDB Community Server | ||
+ | |||
+ | == Releases == | ||
+ | * 4.2 | ||
== Configuration == | == Configuration == | ||
− | + | * <code>/etc/[[mongod.conf]]</code> | |
== Commands == | == Commands == | ||
* Connect to mongoDB: <code>[[mongo]]</code> or <code>mongo --host IP_TO_CONNECT</code> | * Connect to mongoDB: <code>[[mongo]]</code> or <code>mongo --host IP_TO_CONNECT</code> | ||
− | * List | + | * [[List databases]]: <code>[[show dbs]]</code> or <code>[[show databases]]</code> |
− | * Connect to a database: <code>use <your_db_name></code> | + | * [[Connect to a database]]: <code>[[use]] <your_db_name></code> |
* Backup your_db_name database to a file (<code>--archive</code>): <code>[[mongodump]] --archive=test.20150715.archive --db your_db_name</code> | * Backup your_db_name database to a file (<code>--archive</code>): <code>[[mongodump]] --archive=test.20150715.archive --db your_db_name</code> | ||
* Backup database to binary JSON ([[BSON]]) files (<code>--out</code>): <code>mongodump --host mongodb1.example.net --port 37017 --username user --password "pass" --out /opt/backup/mongodump-2011-10-24</code> | * Backup database to binary JSON ([[BSON]]) files (<code>--out</code>): <code>mongodump --host mongodb1.example.net --port 37017 --username user --password "pass" --out /opt/backup/mongodump-2011-10-24</code> | ||
* <code>[[mongod]] --smallfiles --oplogSize 128 --replSet rs0 --storageEngine=[[mmapv1]]</code> | * <code>[[mongod]] --smallfiles --oplogSize 128 --replSet rs0 --storageEngine=[[mmapv1]]</code> | ||
* <code>mongod --smallfiles --oplogSize 128 --replSet rs0 --storageEngine=mmapv1 --bind_ip_all</code> | * <code>mongod --smallfiles --oplogSize 128 --replSet rs0 --storageEngine=mmapv1 --bind_ip_all</code> | ||
− | * db.myCollection.find() or db.myCollection.find().pretty() | + | * <code>[[db.myCollection.find]]()</code> or <code>db.myCollection.find().pretty()</code> |
+ | * <code>[[show tables]]</code>, <code>[[show collections]]</code> | ||
+ | * <code>db.users.find({"name": /.*m.*/})</code> or <code>db.users.find({"name": /m/})</code> | ||
+ | * db.YOUR_COLLETION.find().sort({_id:1}).[[limit]](50); | ||
+ | * <code>[[mongo --eval]] "printjson(db.serverStatus())"</code> | ||
+ | |||
+ | == Docker == | ||
+ | * [[docker logs mongodb]] | ||
== Customers == | == Customers == | ||
Line 45: | Line 61: | ||
== Related terms == | == Related terms == | ||
− | * [[MongoDB Atlas]] | + | * [[MongoDB Atlas]] cloud service |
* [[Eliot Horowitz]] CTO and founder | * [[Eliot Horowitz]] CTO and founder | ||
* [[Ops Manager]] | * [[Ops Manager]] | ||
* <code>[[prometheus]]-[[mongodb]]-[[exporter]]</code> | * <code>[[prometheus]]-[[mongodb]]-[[exporter]]</code> | ||
+ | * [[Rocket.Chat]] | ||
+ | * [[GridFS]] | ||
+ | * [[MongoDB logs]] | ||
+ | * [[MERN]] stack | ||
+ | * [[Amazon DynamoDB]] and [[AWS DMS]] | ||
+ | * [[Collections]] | ||
== Activities == | == Activities == | ||
* Read about [[MongoDB replication]] capabilities https://docs.mongodb.com/manual/faq/replica-sets/ | * Read about [[MongoDB replication]] capabilities https://docs.mongodb.com/manual/faq/replica-sets/ | ||
+ | * Read about MongoDB authentication: https://docs.mongodb.com/manual/core/authentication/ https://stackoverflow.com/questions/4881208/how-to-secure-mongodb-with-username-and-password | ||
== See also == | == See also == | ||
− | * | + | * {{traefik}} |
* [[Cassandra]] | * [[Cassandra]] | ||
* {{MongoDB}} | * {{MongoDB}} | ||
Line 62: | Line 85: | ||
[[Category:Databases]] | [[Category:Databases]] | ||
+ | [[Category:NoSQL]] |
Revision as of 11:34, 23 May 2022
wikipedia:MongoDB (Feb 2009) is an open-source document-oriented database using a JSON-like documents with schema. Listen by default on port TCP 27017.
- Installation:
brew tap mongodb/brew && brew install mongodb-community
- Runnig manually:
mongod --config /usr/local/etc/mongod.conf --fork
/var/log/mongodb/mongodb.log
/var/lib/mongodb/
Contents
Features
- Ad-hoc queries
- Indexing
- Sharding
- Replication
- Load balancing
- File storage
- Aggregation
- Server-side JavaScript execution
- Capped collections
- ACID transactions
Binaries
mongo
MongoDB shellmongodb
mongos
MongoDB Sharded Cluster Query Routermongotop
mongodump
mongorestore
mongoexport
mongoimport
- mongoreplay
- mongostat
- mongoperf
Editions
- MongoDB Community Server
Releases
- 4.2
Configuration
/etc/mongod.conf
Commands
- Connect to mongoDB:
mongo
ormongo --host IP_TO_CONNECT
- List databases:
show dbs
orshow databases
- Connect to a database:
use <your_db_name>
- Backup your_db_name database to a file (
--archive
):mongodump --archive=test.20150715.archive --db your_db_name
- Backup database to binary JSON (BSON) files (
--out
):mongodump --host mongodb1.example.net --port 37017 --username user --password "pass" --out /opt/backup/mongodump-2011-10-24
mongod --smallfiles --oplogSize 128 --replSet rs0 --storageEngine=mmapv1
mongod --smallfiles --oplogSize 128 --replSet rs0 --storageEngine=mmapv1 --bind_ip_all
db.myCollection.find()
ordb.myCollection.find().pretty()
show tables
,show collections
db.users.find({"name": /.*m.*/})
ordb.users.find({"name": /m/})
- db.YOUR_COLLETION.find().sort({_id:1}).limit(50);
mongo --eval "printjson(db.serverStatus())"
Docker
Customers
Related terms
- MongoDB Atlas cloud service
- Eliot Horowitz CTO and founder
- Ops Manager
prometheus-mongodb-exporter
- Rocket.Chat
- GridFS
- MongoDB logs
- MERN stack
- Amazon DynamoDB and AWS DMS
- Collections
Activities
- Read about MongoDB replication capabilities https://docs.mongodb.com/manual/faq/replica-sets/
- Read about MongoDB authentication: https://docs.mongodb.com/manual/core/authentication/ https://stackoverflow.com/questions/4881208/how-to-secure-mongodb-with-username-and-password
See also
- Traefik,
kind: Middleware
- Cassandra
- MongoDB: MongoDB Compass,
mongo
,mongodump, mongorestore
,mongoexport
, MongoDB changelog, MongoDB Enterprise Kubernetes Operator, GridFS, MongoDB Atlas, MongoDB replication, Ops Manager, docker logs mongodb, show collections, show dbs,mongo --help
- RocketChat, MongoDB, GridFS
- Databases: Database management, SQL, NoSQL, Wide column, PostgreSQL, MariaDB, MySQL, Derby DB, MongoDB, Cassandra, SQLite, HSQL2, H2, RocksDB, Microsoft SQL Server, DB2, Oracle Database, Memcached, Berkeley DB, Collation, SingleStore, Amazon Aurora, Graph database, Amazon DynamoDB, PrestoDB, Cache hit ratio, ACID, WAL, ARIES, DBMS, OLTP, OLAP, Database Schema, CockroachDB, Tables, Views, Apache Druid
Advertising: