From 497c82707999cb547ad0f08b943cbb5e59fa0ff3 Mon Sep 17 00:00:00 2001 From: Alexander Tobi Fashakin Date: Tue, 4 Jul 2023 02:08:15 +0100 Subject: [PATCH 1/4] Add blog post about NoSQLBooster with FerretDB --- ...mongodb-gui-using-ferretdb-nosqlbooster.md | 226 ++++++++++++++++++ .../aggregation-operation.png | 3 + .../authentication-tab.png | 3 + .../collection-stats.png | 3 + .../connections-window.png | 3 + .../insert-documents.png | 3 + .../ferretdb-nosqlbooster/mongo-shell.png | 3 + .../nosqlbooster-download-page.png | 3 + .../query-builder-result.png | 3 + .../ferretdb-nosqlbooster/read-collection.png | 3 + .../use-query-builder.png | 3 + .../visual-explain-tool.png | 3 + .../visual-query-builder.png | 3 + .../static/img/blog/nosqlbooster-ferretdb.png | 3 + 14 files changed, 265 insertions(+) create mode 100644 website/blog/2023-07-04-mongodb-gui-using-ferretdb-nosqlbooster.md create mode 100644 website/static/img/blog/ferretdb-nosqlbooster/aggregation-operation.png create mode 100644 website/static/img/blog/ferretdb-nosqlbooster/authentication-tab.png create mode 100644 website/static/img/blog/ferretdb-nosqlbooster/collection-stats.png create mode 100644 website/static/img/blog/ferretdb-nosqlbooster/connections-window.png create mode 100644 website/static/img/blog/ferretdb-nosqlbooster/insert-documents.png create mode 100644 website/static/img/blog/ferretdb-nosqlbooster/mongo-shell.png create mode 100644 website/static/img/blog/ferretdb-nosqlbooster/nosqlbooster-download-page.png create mode 100644 website/static/img/blog/ferretdb-nosqlbooster/query-builder-result.png create mode 100644 website/static/img/blog/ferretdb-nosqlbooster/read-collection.png create mode 100644 website/static/img/blog/ferretdb-nosqlbooster/use-query-builder.png create mode 100644 website/static/img/blog/ferretdb-nosqlbooster/visual-explain-tool.png create mode 100644 website/static/img/blog/ferretdb-nosqlbooster/visual-query-builder.png create mode 100644 website/static/img/blog/nosqlbooster-ferretdb.png diff --git a/website/blog/2023-07-04-mongodb-gui-using-ferretdb-nosqlbooster.md b/website/blog/2023-07-04-mongodb-gui-using-ferretdb-nosqlbooster.md new file mode 100644 index 000000000000..68754a0f500f --- /dev/null +++ b/website/blog/2023-07-04-mongodb-gui-using-ferretdb-nosqlbooster.md @@ -0,0 +1,226 @@ +--- +slug: mongodb-gui-using-ferretdb-nosqlbooster +title: 'MongoDB GUI: Using FerretDB with NoSQLBooster' +authors: [alex] +description: > + Explore how to use FerretDB with a MongoDB GUI tool like NoSQLBooster: setting it up, running queries, performing aggregation operations, and much more. +image: /img/blog/nosqlbooster-ferretdb.png +keywords: [mongodb gui, mongodb gui tools, open source mongodb gui] +tags: [mongodb gui, compatible applications, tutorial] +--- + +![MongoDB GUI: Using FerretDB with NoSQLBooster](/img/blog/nosqlbooster-ferretdb.png) + +Since the release of [FerretDB 1.0](https://blog.ferretdb.io/ferretdb-1-0-ga-opensource-mongodb-alternative/), we've been exploring and showcasing how FerretDB works with real-world applications, especially with MongoDB GUI tools – and NoSQLBooster is one of them. + + + +[NoSQLBooster](https://nosqlbooster.com/) is a cross-platform MongoDB GUI that you can use with [FerretDB](https://www.ferretdb.io/). + +By using FerretDB, an open source MongoDB alternative, with NoSQLBooster, users can have access to NoSQLBooster's built-in features, including Query Code Generator, SQL Query functionality, Comprehensive Server Monitoring tools, Intellisense, among others. + +Just in case you missed it, here is our previous blog post where we covered another MongoDB GUI application with FerretDB: [Using FerretDB with Studio 3T](https://blog.ferretdb.io/using-ferretdb-with-studio-3t/). + +For this particular blog post, we will explore how to use FerretDB with NoSQLBooster, including setting it up, querying it, running aggregation operations, getting performance statistics, and more. + +## Installation and Setup + +### FerretDB + +FerretDB is a truly open-source document database replacement to MongoDB that provides you with familiar query language and commands that you're already used to. +The default backend for FerretDB is PostgreSQL, an open-source, reliable, and popular database supported by a large community of providers and DBAs, making it easy to avoid vendor lock-in. +By the way, we've just released beta support for SQLite backend, and you can read more about this here. + +You can run FerretDB on two cloud providers – [Scaleway](https://www.scaleway.com/en/betas/#managed-document-database) and [Civo Marketplace](https://www.civo.com/marketplace/FerretDB). + +To run your own instance of FerretDB or try it locally, follow the [FerretDB quickstart instruction](https://github.com/FerretDB/FerretDB/blob/main/README.md) or the [installation guide](https://docs.ferretdb.io/quickstart-guide/) here to set it up and running. + +In this tutorial, we'll be using the Docker setup, which requires having Docker installed if you don't have it. + +With Docker installed, we set up our `docker-compose` YAML file with the following configurations: + +```yaml +services: + postgres: + image: postgres + environment: + - POSTGRES_USER=username + - POSTGRES_PASSWORD=password + - POSTGRES_DB=ferretdb + volumes: + - ./data:/var/lib/postgresql/data + ferretdb: + image: ghcr.io/ferretdb/ferretdb + restart: on-failure + ports: + - 27017:27017 + environment: + - FERRETDB_POSTGRESQL_URL=postgres://postgres:5432/ferretdb +networks: + default: + name: ferretdb +``` + +Once that is set up, run `docker compose up -d` in the terminal to start the services. + +Ensure to update the `username` and `password`. + +### NoSQLBooster + +For NoSQLBooster, download the [NoSQLBooster setup](https://nosqlbooster.com/downloads) from their website. + +![Download Page for NoSQLBooster](/img/blog/ferretdb-nosqlbooster/nosqlbooster-download-page.png) + +## Connecting FerretDB with NoSQLBooster + +At this point, you should have NoSQLBooster installed and your FerretDB instance running. + +The next thing to do: connect to FerretDB from NoSQLBooster. +To do this, open the NoSQLBooster application, and click "Connect" to open the Connections window, and then select "New Connection". + +Here, we specify the connection URI string `mongodb://127.0.0.1:27017/` and click "OK" to connect with FerretDB at port `27017`. + +![Connections window with URI](/img/blog/ferretdb-nosqlbooster/connections-window.png) + +Also, you need to specify the username and password to authenticate FerretDB. +Go to the "Authentication" tab on the "Connection Editor" and select LDAP (PLAIN). +At the moment, FerretDB only supports PLAIN authentication. + +![Authentication Tab in Connection Editor](/img/blog/ferretdb-nosqlbooster/authentication-tab.png) + +## Add Demo Data + +Once your connection is set up, you can see all the available databases in the FerretDB instance. +However, in this tutorial, we'll add new demo data to showcase some of the useful features of FerretDB you can access through NoSQLBooster. + +Please insert this demo data into FerretDB to set up the `orders` collection through NoSQLBooster. +Click on the tab with the shell icon to open the MongoDB shell in NoSQLBooster. + +![MongoDB shell](/img/blog/ferretdb-nosqlbooster/mongo-shell.png) + +```js +db.orders.insertMany([ + { + order_id: 1001, + customer: 'John Doe', + items: [ + { name: 'shirt', quantity: 2, price: 25.99 }, + { name: 'pants', quantity: 1, price: 34.99 } + ], + date: new Date('2023-04-25') + }, + { + order_id: 1002, + customer: 'Jane Smith', + items: [ + { name: 'dress', quantity: 1, price: 89.99 }, + { name: 'shoes', quantity: 1, price: 49.99 } + ], + date: new Date('2023-04-26') + }, + { + order_id: 1003, + customer: 'Bob Johnson', + items: [{ name: 'jacket', quantity: 1, price: 69.99 }], + date: new Date('2023-04-27') + }, + { + order_id: 1004, + customer: 'Alice Lee', + items: [ + { name: 'socks', quantity: 3, price: 9.99 }, + { name: 'hat', quantity: 1, price: 19.99 } + ], + date: new Date('2023-04-28') + }, + { + order_id: 1005, + customer: 'Tom Wilson', + items: [ + { name: 'sweater', quantity: 1, price: 59.99 }, + { name: 'scarf', quantity: 2, price: 29.99 } + ], + date: new Date('2023-04-29') + } +]) +``` + +![Insert documents](/img/blog/ferretdb-nosqlbooster/insert-documents.png) + +## Testing Basic FerretDB Operations in NoSQLBooster + +Once you've inserted the documents, navigate to the `orders` collection in NoSQLBooster (you may need to click "Refresh" for the additions to take effect in NoSQLBooster). + +Double-click on the collection to display and read the data from the collection. + +![Read operation](/img/blog/ferretdb-nosqlbooster/read-collection.png) + +Let's run other operations on the database to see what else we can do with the FerretDB in NoSQLBooster. + +### Nested document query using Query Builder + +Using the NoSQLBooster Query Builder, let's find the documents in the collection where the sub-document `item.name` is `shoes`. + +To do this, we'll be using the Query Builder in NoSQLBooster. +You can find this by clicking the "Query" tab. + +![Use Query Builder tab](/img/blog/ferretdb-nosqlbooster/use-query-builder.png) + +Once the Query Builder is open, insert the query terms, then set `items.name` equals `shoes`. + +![The Visual Query Builder](/img/blog/ferretdb-nosqlbooster/visual-query-builder.png) + +Click "OK and Run" to execute the query. + +![Result of the Query Builder](/img/blog/ferretdb-nosqlbooster/query-builder-result.png) + +### Use Aggregate Pipeline Stage + +You can leverage the MongoDB shell in NoSQLBooster to run any command you want. +In the next example, we're going to execute a command that'll return a document with a field named `total_orders` containing the number of documents in the `orders` collection. + +```js +db.orders.aggregate([{ $count: 'total_orders' }]) +``` + +[Aggregation operation] + +Let's also perform some aggregation operations to calculate the total value of all items purchased by each customer. +Run the following command to do this: + +```js +db.orders.aggregate([ + { $unwind: '$items' }, + { $group: { _id: '$_id', total_value: { $sum: '$items.price' } } } +]) +``` + +![Aggregation Operation](/img/blog/ferretdb-nosqlbooster/aggregation-operation.png) + +FerretDB enables users to carry out similar intricate data transformations as you'd find in MongoDB. +In addition to the aggregation commands like `aggregate`, `count`, and `distinct`, FerretDB also supports various pipeline stages, such as `$count`, `$group`, `$limit`, `$match`, `$out`, `$skip`, `$sort`, and `$unwind`. + +For a comprehensive list of FerretDB's supported commands, refer to [this page](https://docs.ferretdb.io/reference/supported-commands/). + +### Monitoring and Performance + +You can also monitor and analyze your FerretDB environment right from the NoSQLBooster interface. + +For example, you can collect statistics for 'orders' collection using the following command. + +```js +db.orders.stats() +``` + +![Collection stats](/img/blog/ferretdb-nosqlbooster/collection-stats.png) + +In addition to this, you can also leverage NoSQLBooster's Visual Explain tool to transform the output of the `explain` command into a tree-like view. + +![Visual Explain tool](/img/blog/ferretdb-nosqlbooster/visual-explain-tool.png) + +## Quickstart Guide for Using ferretDB with NoSQLBooster + +Beyond the examples shown in this article, you can explore other features of FerretDB using NoSQLBooster and other MongoDB GUI applications. +With every new release, FerretDB builds on its list of new features (see them here) and compatible applications. + +If you would like to contribute or are interested in learning more about FerretDB, please reach out to us [here](https://github.com/FerretDB/FerretDB/#community). diff --git a/website/static/img/blog/ferretdb-nosqlbooster/aggregation-operation.png b/website/static/img/blog/ferretdb-nosqlbooster/aggregation-operation.png new file mode 100644 index 000000000000..3545eadf61aa --- /dev/null +++ b/website/static/img/blog/ferretdb-nosqlbooster/aggregation-operation.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a3a3c74c8e026207af82e41c5915f0fce26bcf9af61e64e4fb5479c0d639053d +size 206821 diff --git a/website/static/img/blog/ferretdb-nosqlbooster/authentication-tab.png b/website/static/img/blog/ferretdb-nosqlbooster/authentication-tab.png new file mode 100644 index 000000000000..c074168c3af9 --- /dev/null +++ b/website/static/img/blog/ferretdb-nosqlbooster/authentication-tab.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b6c2d1e1786d005c99ae66cc27a7b876d78c161fc2ae528c044a73056dacd4db +size 108383 diff --git a/website/static/img/blog/ferretdb-nosqlbooster/collection-stats.png b/website/static/img/blog/ferretdb-nosqlbooster/collection-stats.png new file mode 100644 index 000000000000..a9f42c4507f9 --- /dev/null +++ b/website/static/img/blog/ferretdb-nosqlbooster/collection-stats.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2c69c8cbf0244e04917b76f24237487178202148a8b7c10f4766a6c5d0aa037b +size 212215 diff --git a/website/static/img/blog/ferretdb-nosqlbooster/connections-window.png b/website/static/img/blog/ferretdb-nosqlbooster/connections-window.png new file mode 100644 index 000000000000..61ab0b40ce62 --- /dev/null +++ b/website/static/img/blog/ferretdb-nosqlbooster/connections-window.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9e14964561cedf20092474fd56410ca40b7da048c7ee4ce42959b7589c9999ca +size 128790 diff --git a/website/static/img/blog/ferretdb-nosqlbooster/insert-documents.png b/website/static/img/blog/ferretdb-nosqlbooster/insert-documents.png new file mode 100644 index 000000000000..d598aa5b4b8c --- /dev/null +++ b/website/static/img/blog/ferretdb-nosqlbooster/insert-documents.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:926d3d84bb96a3de0381c61ee55466204886735324a3e716c6c9913ec0c38acf +size 378052 diff --git a/website/static/img/blog/ferretdb-nosqlbooster/mongo-shell.png b/website/static/img/blog/ferretdb-nosqlbooster/mongo-shell.png new file mode 100644 index 000000000000..4b5d389b384d --- /dev/null +++ b/website/static/img/blog/ferretdb-nosqlbooster/mongo-shell.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4e4f92ae28057ff3ab11e2e14b8911d89313c308a2bb3b0d950810eadcb2e306 +size 43375 diff --git a/website/static/img/blog/ferretdb-nosqlbooster/nosqlbooster-download-page.png b/website/static/img/blog/ferretdb-nosqlbooster/nosqlbooster-download-page.png new file mode 100644 index 000000000000..b58bed5a0028 --- /dev/null +++ b/website/static/img/blog/ferretdb-nosqlbooster/nosqlbooster-download-page.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c7de4c97f2af76f13658d5eeb5055393be78102e0f5093703a99065d0411ccbf +size 332803 diff --git a/website/static/img/blog/ferretdb-nosqlbooster/query-builder-result.png b/website/static/img/blog/ferretdb-nosqlbooster/query-builder-result.png new file mode 100644 index 000000000000..cafec7c6fddc --- /dev/null +++ b/website/static/img/blog/ferretdb-nosqlbooster/query-builder-result.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ade9f7ae633c95bdb3c42bb0b749cecb7a994c613aaf07904d19e8bc699d3e82 +size 242092 diff --git a/website/static/img/blog/ferretdb-nosqlbooster/read-collection.png b/website/static/img/blog/ferretdb-nosqlbooster/read-collection.png new file mode 100644 index 000000000000..220b0675f769 --- /dev/null +++ b/website/static/img/blog/ferretdb-nosqlbooster/read-collection.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c711158959aa8473cd6234f1b4f0e0ed9f452ff6758c0c685abf1f23e85df2b0 +size 366553 diff --git a/website/static/img/blog/ferretdb-nosqlbooster/use-query-builder.png b/website/static/img/blog/ferretdb-nosqlbooster/use-query-builder.png new file mode 100644 index 000000000000..3c35add34b8f --- /dev/null +++ b/website/static/img/blog/ferretdb-nosqlbooster/use-query-builder.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:96a36d3c91e1bfd654ac3c33748497c05040eb725e61e1e3f4f51f5bbc865602 +size 46799 diff --git a/website/static/img/blog/ferretdb-nosqlbooster/visual-explain-tool.png b/website/static/img/blog/ferretdb-nosqlbooster/visual-explain-tool.png new file mode 100644 index 000000000000..8c40103da7cf --- /dev/null +++ b/website/static/img/blog/ferretdb-nosqlbooster/visual-explain-tool.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ae301a4902f931c9c2a7c88bc5ff41109fc94ea586d3dca814454298b61aaf53 +size 177177 diff --git a/website/static/img/blog/ferretdb-nosqlbooster/visual-query-builder.png b/website/static/img/blog/ferretdb-nosqlbooster/visual-query-builder.png new file mode 100644 index 000000000000..eb7f74fa4853 --- /dev/null +++ b/website/static/img/blog/ferretdb-nosqlbooster/visual-query-builder.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:05f6f44ea462be6b99af9d4ea8e7629343968ca30a145411d46f8a42729f7085 +size 144822 diff --git a/website/static/img/blog/nosqlbooster-ferretdb.png b/website/static/img/blog/nosqlbooster-ferretdb.png new file mode 100644 index 000000000000..9eb38054d444 --- /dev/null +++ b/website/static/img/blog/nosqlbooster-ferretdb.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:570dc49825ced3e4dfecf5eb87a53b183ac0d9677ac4afbb584bf25eb428b436 +size 129689 From 6edd71ab08121ff45c32f977b880dfef6a4fd89a Mon Sep 17 00:00:00 2001 From: Alexander Tobi Fashakin Date: Tue, 4 Jul 2023 13:47:38 +0100 Subject: [PATCH 2/4] update blogpost --- ... => 2023-07-06-mongodb-gui-using-ferretdb-nosqlbooster.md} | 0 website/static/img/blog/nosqlbooster-ferretdb.png | 4 ++-- 2 files changed, 2 insertions(+), 2 deletions(-) rename website/blog/{2023-07-04-mongodb-gui-using-ferretdb-nosqlbooster.md => 2023-07-06-mongodb-gui-using-ferretdb-nosqlbooster.md} (100%) diff --git a/website/blog/2023-07-04-mongodb-gui-using-ferretdb-nosqlbooster.md b/website/blog/2023-07-06-mongodb-gui-using-ferretdb-nosqlbooster.md similarity index 100% rename from website/blog/2023-07-04-mongodb-gui-using-ferretdb-nosqlbooster.md rename to website/blog/2023-07-06-mongodb-gui-using-ferretdb-nosqlbooster.md diff --git a/website/static/img/blog/nosqlbooster-ferretdb.png b/website/static/img/blog/nosqlbooster-ferretdb.png index 9eb38054d444..2c1075e3e7ee 100644 --- a/website/static/img/blog/nosqlbooster-ferretdb.png +++ b/website/static/img/blog/nosqlbooster-ferretdb.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:570dc49825ced3e4dfecf5eb87a53b183ac0d9677ac4afbb584bf25eb428b436 -size 129689 +oid sha256:a06ab125ef8bef630ab202c7e29f3dbbfc0415fa45a3293e2bd45fd1828d0d98 +size 125709 From 546acb969f20645380cdb737684a6c00c199282e Mon Sep 17 00:00:00 2001 From: Alexander Tobi Fashakin Date: Mon, 10 Jul 2023 06:24:59 +0100 Subject: [PATCH 3/4] update date --- ...r.md => 2023-07-10-mongodb-gui-using-ferretdb-nosqlbooster.md} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename website/blog/{2023-07-06-mongodb-gui-using-ferretdb-nosqlbooster.md => 2023-07-10-mongodb-gui-using-ferretdb-nosqlbooster.md} (100%) diff --git a/website/blog/2023-07-06-mongodb-gui-using-ferretdb-nosqlbooster.md b/website/blog/2023-07-10-mongodb-gui-using-ferretdb-nosqlbooster.md similarity index 100% rename from website/blog/2023-07-06-mongodb-gui-using-ferretdb-nosqlbooster.md rename to website/blog/2023-07-10-mongodb-gui-using-ferretdb-nosqlbooster.md From c32931c67809eae3b911fec6c43314b30164f83b Mon Sep 17 00:00:00 2001 From: Alexander Tobi Fashakin Date: Mon, 10 Jul 2023 13:08:27 +0100 Subject: [PATCH 4/4] Update blog --- .../2023-07-10-mongodb-gui-using-ferretdb-nosqlbooster.md | 4 ++-- .../img/blog/ferretdb-nosqlbooster/aggregation-count.png | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) create mode 100644 website/static/img/blog/ferretdb-nosqlbooster/aggregation-count.png diff --git a/website/blog/2023-07-10-mongodb-gui-using-ferretdb-nosqlbooster.md b/website/blog/2023-07-10-mongodb-gui-using-ferretdb-nosqlbooster.md index 68754a0f500f..97a75f925636 100644 --- a/website/blog/2023-07-10-mongodb-gui-using-ferretdb-nosqlbooster.md +++ b/website/blog/2023-07-10-mongodb-gui-using-ferretdb-nosqlbooster.md @@ -183,7 +183,7 @@ In the next example, we're going to execute a command that'll return a document db.orders.aggregate([{ $count: 'total_orders' }]) ``` -[Aggregation operation] +![Aggregation operation](/img/blog/ferretdb-nosqlbooster/aggregation-count.png) Let's also perform some aggregation operations to calculate the total value of all items purchased by each customer. Run the following command to do this: @@ -221,6 +221,6 @@ In addition to this, you can also leverage NoSQLBooster's Visual Explain tool to ## Quickstart Guide for Using ferretDB with NoSQLBooster Beyond the examples shown in this article, you can explore other features of FerretDB using NoSQLBooster and other MongoDB GUI applications. -With every new release, FerretDB builds on its list of new features (see them here) and compatible applications. +With every new release, FerretDB builds on its list of new features ([see them here](https://blog.ferretdb.io/ferretdb-v-1-5-0-beta-support-sqlite/)) and compatible applications. If you would like to contribute or are interested in learning more about FerretDB, please reach out to us [here](https://github.com/FerretDB/FerretDB/#community). diff --git a/website/static/img/blog/ferretdb-nosqlbooster/aggregation-count.png b/website/static/img/blog/ferretdb-nosqlbooster/aggregation-count.png new file mode 100644 index 000000000000..3b7910c38afa --- /dev/null +++ b/website/static/img/blog/ferretdb-nosqlbooster/aggregation-count.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d9f81516aec2c4bcc72160bfb3be45c3f33498d865eec9d3f413d68011769501 +size 89611