> For the complete documentation index, see [llms.txt](https://n000b3r.gitbook.io/oscp-notes/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://n000b3r.gitbook.io/oscp-notes/services/27017-mongodb.md).

# (27017) Mongodb

<details>

<summary>Background Info</summary>

MongoDB is a document-oriented NoSQL database. In a document-oriented NoSQL database, data is organized into

* Databases
* Collections (tables in MySQL)
* Documents (rows in MySQL)
* Fields (columns in MySQL)

</details>

<details>

<summary>Boolean operators</summary>

* $and&#x20;
* $or
* $eq (equivalent to = in MySQL)

</details>

<details>

<summary>Commands</summary>

* show databases;
* use <*database\_name*>;
* show collections;
* db <*collection\_name>*.find(); (to show fields)

</details>

<details>

<summary>Connect to Remote MongoDB</summary>

```bash
apt-geintt install mongodb-clients
mongo --host 192.168.192.110:27017
```

</details>
