How to Create/Delete a Database with MongoDB Shell

October 2, 2021 A Goodman

This short post demonstrates how to create and drop a MongoDB database by using the command line. Creating a New Database The “use [your database name]” command will create a new database if it doesn’t exist,…

How to Check MongoDB Version on Windows, Mac, and Linux

October 2, 2021 A Goodman

You can see the version of MongoDB installed on your computer or server by using the following command: Here’s the result I get on my Mac after executing the mentioned command: And this’s the output I…

MongoDB: Renaming a Database with Command Line

October 2, 2021 A Goodman

This short post shows you how to change the name of a MongoDB database by using the command line (MongoDB shell). At this time, there are no official out-of-the-box tools from the MongoDB team that can…

SQLite: Select Random Records from a Table

September 12, 2021 A Goodman

In SQLite, you can randomly get one or multiple rows from a table by using the following select statement: Example Let’s say we have a table named users: Column Data Type id INTEGER email TEXT name…

MongoDB: Get a Random Document from a Collection

September 12, 2021 Guest Contributor

This short and straight-to-the-point post shows you how to randomly retrieve single or multiple documents from a collection in your MongoDB database by using the $sample aggregation. 1. To get a random document: If you want…

MongoDB: Import/Export a Database with Command Line

September 12, 2021 A Goodman

If you’re using MongoDB, you can export or import a whole database by using a single command line. All of the collections of that database will be exported/imported at once. It’s super convenient when backup/restore data….

4 Ways to Store Data Offline in Flutter

February 24, 2021 A Goodman

There are many cases where you need to store data locally on users’ devices instead of using remote cloud servers or APIs, for example, you may need to persist data across app launches, or download a…

How to see your MySQL version in macOS

June 20, 2020 A Goodman

In order to check you MySQL version in macOS, just open the terminal and perform the following command: You’ll see something similar to this: Simple as that 🙂