You are reading the article How To Create, Alter, Delete Database In Mongodb updated in December 2023 on the website Kientrucdochoi.com. We hope that the information we have shared is helpful to you. If you find the content interesting and meaningful, please share it with your friends and continue to follow and support us for the latest updates. Suggested January 2024 How To Create, Alter, Delete Database In Mongodb
Introduction to MongoDB DatabaseMongoDB database is defined as a created database for database operations; using MongoDB database, we are creating the collection into it. MongoDB is not a structured database, so we have not used create database statements which we have used in other databases like MySQL and PostgreSQL. We can create the database in MongoDB by using the database and using the keyword, it is used to create a new database in MongoDB; after using the database, we are creating the collection into the same. We can create multiple databases on a single MongoDB server default database that we have used in MongoDB is db.
Start Your Free Data Science Course
Hadoop, Data Science, Statistics & others
How to Create Database in MongoDB?Basically, we have used the use command to create a new database in MongoDB.
Below is the syntax :
Use name_of_database
In the above syntax, use keyword specifies that create a new database. We can create any new database by using use keywords.
The name of the database shows the database name that we are creating in MongoDB. We can create a database by specifying the name of the database parameter.
If using the database is exist on the server it will use the existing database instead of creating the new database.
The below example shows that create a new database:
Code:
db
Output:
In the above example, we have created a database name as db_test after creating, we can see the connected database name by using the db command.
We can show all the created and system databases by using the show dbs command.
The below example shows that list as follows:
Code:
show dbs
Output:
After using a database, it will not show in the show dbs command; after creating a collection or object of the database then, it will show using the show dbs command.
The below example shows the same:
Code:
show dbs
Output:
In the above first example, we have created a database named db_test1 it will show a connected database by using the db command but not show in the list of databases, because we have not created any collection or object into the db_test1 database.
In the second example, we have created one collection at the time of data insertion after creating the collection into the db_test1 database; the name of the database is shown using the show dbs command.
Next time after using the use db_test1 command, we have automatically connected to the db_test1 database.
Admin and local databases are the system database which was used in the MongoDB server.
Show dbs command will show all database names and sizes of all databases.
How to Alter Database in MongoDB?
We are using the copyDatabase command to rename a database.
Syntax:
db.dropDatabase();
In above syntax copyDatabase is defined as the command used to copy one database to another database with a different name.
The name of the old database is defined as the old database name, which we have used to copy the database to a new name.
The name of the new database is defined as the new database name, which we are renaming using the copyDatabase command.
We cannot directly rename the database; to rename the database, we are using the copyDatabase command.
After copying to the database, we are connecting to the old database and we have to delete the old database.
The below example shows that alter database command to rename the database with a new name:
Code:
show dbs
Output:
In the above example, first, we have copied the database from db_test to db_test1 database. After a successful copy from db_test to db_test1, we connected to the db_test database.
After connecting, we dropped the old database using the dropDatabase command.
Basically, there is no rename database command available in MongoDB, so instead of rename database command, we are using copyDatabase.
How to Delete Database in MongoDB?Below syntax and example show how to delete the database:
We have dropped the database in MongoDB using dropDatabase command.
The below syntax shows to drop the database, first, we need to connect the specified database which we are dropping.
Syntax:
In the above syntax name of the database is defined as the database name which we are dropping from the server.
Given below example shows deleted database:
Code:
show dbs
Output:
In the above example, we have deleted the database name db_test1.
To delete the database, we need to connect to the specified database, which we are dropping in MongoDB.
The connected database will be deleted from the database server; so after using this command, we need to check the database name which we have connected.
The below example shows the same:
Code:
show dbs
Output:
In the above example, first, we have connected to the db_test database. After connecting, we have deleted the same from the database server.
ConclusionWe are creating the database by using the use db command, and if the database already exists in the database, then we are connecting to the existing database. We are renaming the database by using the copyDatabase command, also, we can drop the database by using dropDatabase command.
Recommended ArticlesThis is a guide to MongoDB Database. Here we discuss how to create, alter, and delete databases in MongoDB with respective query examples. You may also have a look at the following articles to learn more –
You're reading How To Create, Alter, Delete Database In Mongodb
How To Connect Database In Java?
How to Connect Database in Java?
Hadoop, Data Science, Statistics & others
What is JDBC?JDBC stands for Java Database Connectivity, and it helps a Java program to perform different kinds of operations over the database, such as create, read, update, and delete. Also, JDBC is a Java API.
By using JDBC, a programmer should be able to:
Establish a connection with the database
Run SQL commands by sending them to the database
Interprets the results that come from a database
Creating a Database to Connect Database in JavaBefore working with JDBC, it is required to have a database to connect to it. We will be making use of the Oracle Database for the sake of our illustration. Please download the Oracle 11g express edition from the below link.
I already have Oracle 10g installer ready with me, as you can see below:
Source: From my desktop
Source: From my desktop
Source: From my desktop
Source: From my desktop
Source: From my desktop
Source: From my desktop
Now once you log in, the very first screen that you will see will look like below:
Source: From my desktop
Source: From my desktop
As you can see, we have successfully created a table named Educba.
Connect Database in JavaA few interfaces and classes are used to connect to a database and perform operations using JDBC API.
We will explain one by one, but let me first present to you the below program:
Source: From my desktop
Below are the interfaces which we will be using to connect to the database and perform operations over it:
Driver Manager
Connection
Statement
Result set
Prepared statement
Let us look at the operations we can perform as a part of the JDBC operation.
Store the data from an entity to a database, i.e., they create an operation.
Retrieve the data to the entity or a bean from a database
Update the data for the entity or the bean in the database
Delete or remove the data on the entity or a bean from the database.
No matter what operation we perform, some basic steps would remain the same:
Load the driver.
class.forName("oracle.jdbc.driver.OracleDriver");Create a URL string
String url="jdbc:oracle:thin:@172:.26.132.40:1521:orclilp";Use the driver manager to create a connection
con=DriverManager.getConnection(URL, USERNAME, PASSWORD);Use Connection reference to create statement
stmt = conn.createStatement();Use a statement to execute the query
6. Process the result set ( optional, depends )
7. Release the resources in the final block.
IllustrationAs we use the Oracle database in our illustration, we need to have the required driver that Oracle should provide. The driver class is usually in the form of a jar file with the name chúng tôi This driver should be imported to your Java program as a part of “Referenced Libraries” if it is not there.
If you have installed Oracle 11g in your C folder, it can ideally be found in the below path: ( If it is not there, it can be easily downloaded from here )
C: oraclexe app oracle product 10.2.0 server jdbc lib
Source: From my desktop
Many jar files should be available; however, chúng tôi is the latest. The same can be used for our purpose. This jar should be added to the classpath of the project. Please check the below image.
Source: From my desktop
Let us create an artist table with the following attributes: ( You can directly run the SQL command line as a separate module of Oracle Express Edition. But first, you need to connect, and you can execute the “connect” command to connect to the database.
Source: From my desktop
As a part of this illustration, we would be creating three Java classes, i.e., Artist.java, CreateTable.java, and ArtistManagementDao.java, to achieve this.
Also, we must create a class called Artist Bean in the Java layer. This class should have attributes of the Artist with the above context. It will look like below:
Artist.javaLet us create two other Java classes with the name ArtistManagementDao and CreateTable.java.
ArtistManagementDao.java package com; import java.sql.Connection; import java.sql.DriverManager; import java.sql.PreparedStatement; import java.sql.SQLException; public class ArtistManagementDao { private final static String DRIVERNAME="oracle.jdbc.driver.OracleDriver"; private final static String URL="jdbc:oracle:thin:@LENOVO-PC:1521:XE"; private final static String USERNAME="System"; private final static String PASSWORD="Your DB password"; private Connection con =null; public void addArtist(Artist a) { try { Class.forName(DRIVERNAME); String sql="insert into Artist1 values (?,?)"; con=DriverManager.getConnection(URL, USERNAME, PASSWORD); PreparedStatement pst=con.prepareStatement(sql); pst.setString(1, a.getArtistID()); pst.setString(2, a.getArtistName()); pst.executeUpdate(); } catch (ClassNotFoundException e) { System.out.println(e); } catch (SQLException e) { System.out.println(e); } } }Explanation:
The Dao class helps us to isolate the application/business layer from the persistence layer. This is usually the relational database.
We have created a DB URL with your computer name and DB port number ( ideally 1521 ), preceded by JDBC:oracle:thin:@. Then, we created a username and password to pass these attributes during the Database connection. It is highly recommended to encrypt these values in the production environment.
Inside the addArtist method, we tried to establish our connection by following the steps we learned earlier using a conn statement.
We have used the insert method to push values from attributes to the database.
In the next statement, to test, we have the get statement to retrieve values from the database.
We have also tried to catch block for catching any exceptions and throwing out the same.
CreateTable.java package com; import java.sql.*; public class CreateTable{ static final String DB_URL = "jdbc:oracle:thin:@LENOVO-PC:1521:XE"; static final String USER = "System"; static final String PASS = "Your DB Password"; public static void main(String[] args) { Connection conn = null; Statement stmt = null; try{ ArtistManagementDao am=new ArtistManagementDao(); Artist a=new Artist(); Class.forName("oracle.jdbc.driver.OracleDriver"); System.out.println("Connecting to a selected database..."); conn = DriverManager.getConnection(DB_URL, USER, PASS); System.out.println("Connected to database successfully"); System.out.println("Creating table"); stmt = conn.createStatement(); String sql = "CREATE TABLE Artist3 " + "(ArtistID varchar2(5) primary key not NULL, " + " ArtistName varchar2(25))"; stmt.executeUpdate(sql); System.out.println("Created table in given database..."); a.setArtistId("abc"); a.setArtistName("ankit"); am.addArtist(a); System.out.println("nArtistID="+a.getArtistID()+"nArtistName="+a.getArtistName()); }catch(SQLException se){ se.printStackTrace(); }catch(Exception e){ e.printStackTrace(); }finally{ try{ if(stmt!=null) conn.close(); }catch(SQLException se){ } try{ if(conn!=null) conn.close(); }catch(SQLException se){ se.printStackTrace(); } } } }Explanation:
We have created a DB URL with your computer name and DB port number ( ideally 1521 ), preceded by JDBC:oracle:thin:@. Then, we created a username and password to pass these attributes during the Database connection. It is highly recommended to encrypt these values in the production environment.
In the chúng tôi class, we created the objects “am” and “a” of the chúng tôi and chúng tôi class, respectively.
Then we tried to establish our connection by following the steps we learned earlier using a conn statement.
Then we created a table with the name Artist3 and updated the database or pushed this to the database using the execute the statement.
If we would like to assign values to the attributes, we will use the object we created for the artist class and note that this class will not insert the value into the database; it will be ArtistmanagementDao class. We already have stored values in attributes and will see in the day class how to push this to the database.
Finally, we have used the “am” object from ArtistManagementDao to pass this object “a” to the method addArtist() of ArtistManagementDao java class.
We have also tried to catch block for catching any exceptions and throwing out the same.
Recommended ArticlesThis has been a guide on how to connect database in Java. Here we have discussed how to connect the database in Java and the interfaces and classes used to connect a database. You may also look at the following articles to learn more –
How To Create, Edit And Delete A Table Relationship In Microsoft Access
In Microsoft Access, a Relationship helps you to merge or link data from one table to another. Relationships allow the user to create Queries, Forms, and Reports. When tables are created for each topic in a database, you must place common fields into the table related and form a relationship with them for information to be brought together again.
Create, Edit, Delete a Table Relationship in AccessThere are three types of Relationships:
One-to-One Relationship: One-to-One Relationship is the simplest kind of Relationship and the least common because the information related is stored in the same table. It links one table to a single record in another table; Primary Keys links tables. One- to- One Relationship can connect a table with many fields together and separate a table for security reasons.
A One-to-Many relationship: One-to-Many Relationship is the most common Relationship; it links each record in one table to several records in another table. Only one of the fields been linked can be the Primary Key, and the Primary Key must have one record for many records in another table.
Many-to-Many relationships: Many-to-Many Relationship requires a Junction Table, which includes the Primary Key column of the two tables you want to connect. Many -to Many Relationship allows you to connect each row of one table to many rows in another table.
Why use table relationships in Access?
Table Relationships updates your form and report designs – When you design a form and report, a Relationship is needed for Access to gather the information that can be placed in the form or report you have created.
Table Relationships updates your query design – For records to work from more than one table, a query must be created to join these tables. The query works by matching the values in the first table’s primary key field with the foreign key in the second table.
Referential Integrity can be enforced in a table relationship – Referential Integrity helps to prevent orphan records in your database. An orphan record is a record with reference to another record that does not exist.
In this article, we are going to explain:
How to Create a Relationship in Microsoft Access
How to Edit a Relationship in Microsoft Access
How to Delete a Relationship in Microsoft Access
1] How to Create a Relationship in Microsoft AccessThe Edit Relationship dialog box will be seen again with your selected choice; press create. There is also a shortcut option where you can drag the Primary Key from one table to another table; any table linked must be related to the Primary Key. This will form a relationship between the two tables.
2] How to edit relationships in Microsoft AccessYou can modify your Relationships in Microsoft Access; here are a few steps in doing so.
Double-tap on the Relationship Line, and the Edit Relationship dialog box will show up.
Make whatever changes you want to make.
3] Deleting Relationships in Microsoft AccessTo Delete a Relationship, you must remove the line from the two tables; these are the measures.
A dialog box will pop up asking you ‘if you are sure you want to permanently delete the Relationship.’
Related read: How to build Tables with Table Designer in Access.
How To Add Super Privileges To Mysql Database?
Firstly, check the MySQL database with DESC command.
The following is the output.
| Field | Type | Null | Key | Default | Extra | | Host | char(60) | NO | PRI | | | | Db | char(64) | NO | PRI | | | | User | char(32) | NO | PRI | | | | Select_priv | enum('N','Y') | NO | | N | | | Insert_priv | enum('N','Y') | NO | | N | | | Update_priv | enum('N','Y') | NO | | N | | | Delete_priv | enum('N','Y') | NO | | N | | | Create_priv | enum('N','Y') | NO | | N | | | Drop_priv | enum('N','Y') | NO | | N | | | Grant_priv | enum('N','Y') | NO | | N | | | References_priv | enum('N','Y') | NO | | N | | | Index_priv | enum('N','Y') | NO | | N | | | Alter_priv | enum('N','Y') | NO | | N | | | Create_tmp_table_priv | enum('N','Y') | NO | | N | | | Lock_tables_priv | enum('N','Y') | NO | | N | | | Create_view_priv | enum('N','Y') | NO | | N | | | Show_view_priv | enum('N','Y') | NO | | N | | | Create_routine_priv | enum('N','Y') | NO | | N | | | Alter_routine_priv | enum('N','Y') | NO | | N | | | Execute_priv | enum('N','Y') | NO | | N | | | Event_priv | enum('N','Y') | NO | | N | | | Trigger_priv | enum('N','Y') | NO | | N | | 22 rows in set (0.06 sec)Now let us see the query to give privileges.
Query OK, 0 rows affected (0.00 sec) Rows matched: 1 Changed: 0 Warnings: 0Let us now display the table using DESC command.
| Field | Type | Null | Key | Default | Extra | | Host | char(60) | NO | PRI | | | | User | char(32) | NO | PRI | | | | Select_priv | enum('N','Y') | NO | | N | | | Insert_priv | enum('N','Y') | NO | | N | | | Update_priv | enum('N','Y') | NO | | N | | | Delete_priv | enum('N','Y') | NO | | N | | | Create_priv | enum('N','Y') | NO | | N | | | Drop_priv | enum('N','Y') | NO | | N | | | Reload_priv | enum('N','Y') | NO | | N | | | Shutdown_priv | enum('N','Y') | NO | | N | | | Process_priv | enum('N','Y') | NO | | N | | | File_priv | enum('N','Y') | NO | | N | | | Grant_priv | enum('N','Y') | NO | | N | | | References_priv | enum('N','Y') | NO | | N | | | Index_priv | enum('N','Y') | NO | | N | | | Alter_priv | enum('N','Y') | NO | | N | | | Show_db_priv | enum('N','Y') | NO | | N | | | Super_priv | enum('N','Y') | NO | | N | | | Create_tmp_table_priv | enum('N','Y') | NO | | N | | | Lock_tables_priv | enum('N','Y') | NO | | N | | | Execute_priv | enum('N','Y') | NO | | N | | | Repl_slave_priv | enum('N','Y') | NO | | N | | | Repl_client_priv | enum('N','Y') | NO | | N | | | Create_view_priv | enum('N','Y') | NO | | N | | | Show_view_priv | enum('N','Y') | NO | | N | | | Create_routine_priv | enum('N','Y') | NO | | N | | | Alter_routine_priv | enum('N','Y') | NO | | N | | | Create_user_priv | enum('N','Y') | NO | | N | | | Event_priv | enum('N','Y') | NO | | N | | | Trigger_priv | enum('N','Y') | NO | | N | | | Create_tablespace_priv | enum('N','Y') | NO | | N | | | ssl_type | enum('','ANY','X509','SPECIFIED') | NO | | | | | ssl_cipher | blob | NO | | NULL | | | x509_issuer | blob | NO | | NULL | | | x509_subject | blob | NO | | NULL | | | max_questions | int(11) unsigned | NO | | 0 | | | max_updates | int(11) unsigned | NO | | 0 | | | max_connections | int(11) unsigned | NO | | 0 | | | max_user_connections | int(11) unsigned | NO | | 0 | | | plugin | char(64) | NO | | caching_sha2_password | | | authentication_string | text | YES | | NULL | | | password_expired | enum('N','Y') | NO | | N | | | password_last_changed | timestamp | YES | | NULL | | | password_lifetime | smallint(5) unsigned | YES | | NULL | | | account_locked | enum('N','Y') | NO | | N | | | Create_role_priv | enum('N','Y') | NO | | N | | | Drop_role_priv | enum('N','Y') | NO | | N | | | Password_reuse_history | smallint(5) unsigned | YES | | NULL | | | Password_reuse_time | smallint(5) unsigned | YES | | NULL | | 49 rows in set (0.01 sec)The privileges added can be easily seen in the above table. To add super privileges to MySQL database, the following is the syntax.
After executing the above query, do not forget to end it with the following command.
FLUSH PRIVILEGES;How To Find And Delete Empty Folders In Android?
How To Find and Delete Empty Folders In Android?
Are you wondering how you can delete empty folders on Android? You’ve come to the right place. In this post, we have listed a complete guide on what empty folders are, whether it is safe to delete empty folders and how you can do so with minimal effort.
Also read: How To Recover Data From An Android Phone With a Broken Screen.
Let’s quickly begin and understand Android’s storage space management. What are Empty Folders on Android?Also read: 10 Best Data Recovery Apps For Android
How to Delete Empty Folders on Android?When it comes to deleting empty folders on Android, you should always rely on an app for the secure deletion of data.
Open the Google Play Store app on your Android phone and search for the “Empty Folder Cleaner” app. Install this application on your smartphone.
Launch the app and get started. The “Empty Folder Cleaner” app will now thoroughly scan your device to look for empty folders.
Once the scanning process is completed, the app will list all the results on the screen.
You can now choose which folders you need to remove or move to your device’s primary storage section.
And that’s it, fellas. This is how you can quickly remove empty folders on your Android device.
Tip For Windows Users:
Download and Install the Duplicate Files Fixer App to Remove Empty Folders (Windows)
Talking of Windows, manually deleting the empty folders is a tedious task, and it will consume too much of your time and effort. Hence, one of the best and most secure ways to clean empty folders on Windows is by using a reliable app like “Duplicate Files Fixer,” which helps you get the job done.
Duplicate Files Fixer is a powerful app that will allow you to find and delete empty folders on your device to organize your data efficiently. It offers you the safest and more secure ways to get rid of empty folders on a Windows PC.
Download Duplicate Files Fixer For Windows
Complete Review on Duplicate Files Fixer
Why Should You Choose the Duplicate Files Fixer App?
● Scans all types of storage media, including hard drives, connected drives, and so on.
Also read: How To Use Android Phone As A GPS Tracker Device.
Conclusion:
This wraps up our guide on how to find and delete empty folders on Android. In just a few steps, you can get rid of the “Empty Folders” stored on your Android phone to restore free storage space within no time. You can use the “Empty Folder Cleaner” app for a secure deletion process. The Empty Folder Cleaner app is a simple, easy-to-use solution to keep your phone’s performance optimized.
Related Topics
Quick Reaction:
About the author
Tweak Library Team
Complete Guide To Mongodb Commands
Introduction to MongoDB Commands
MongoDB is a cross-platform, document-oriented, open-source database management system with high availability, performance, and scalability. MongoDB, a NoSQL database, finds extensive use in big data applications and other complex data processing tasks that do not align well with the relational database model. Instead of using the relational database notion of storing data in tables, MongoDB architecture is built on collections and documents. Here we discuss the MongoDB commands.
Start Your Free Data Science Course
Hadoop, Data Science, Statistics & others
Why MongoDB Commands?
It can easily control global data, ensuring fast performance and compliance.
It provides a flexible data model. This goes with the case where the app needs to be built from scratch or the case of updating a single record.
Scaling the application ensures that there is no downtime.
Features
MongoDB command uses a master-slave replication concept. To prevent database downtime, this replica feature is essential.
MongoDB command comes with the auto-sharding feature, which distributes data across multiple physical partitions known as shards. The result of which automatic load balancing happens.
It’s schema-less. Hence more efficient.
Basic of MongoDB Commands 1. Create databaseIn MongoDB use, DATABASE_NAME is used to create a database. If this name database doesn’t exist, it will get created, and else it will return the existing one.
To check the current database now:
By default, the MongoDB command comes with the database name “test.” Suppose you inserted a document without specifying the database; MongoDB will automatically store it in a “test” database.
2. Drop DatabaseIf the database is not specified, it will delete the default database, “test.”
3. Create CollectionTo create a collection, the MongoDB command used is: db.createCollection(name, options)
Here, the name is the Collection’s name & options are a document used to specify the Collection’s configuration. Though the “Options” parameter is optional, it’s good to provide it.
4. Drop Collection 5. Insert DocumentTo insert data into a database collection in MongoDB, you can use the “insert()” or “save()” method.
Here “mycol” is the collection name. If the Collection doesn’t exist, then the MongoDB command will create the database collection, which will be inserted.
6. Query DocumentQuerying Collection is done by the find() method.
As the find() method will show the findings in a non-structured way, a structured pretty() method is used to get the results.
Intermediate MongoDB Commands 1. Limit()This MongoDB command limits the no. of records need to use in MongoDB. The argument of this function accepts only number types. The argument is the number of the Document that needs to be displayed.
2. Sort()This is to the records of MongoDB. 1 & -1 are used to sort the documents. 1 is for ascending, whereas -1 is for descending.
3. Indexing is the concept that helps MongoDB to scan documents in an inefficient way Advanced Commands of MongoDB 1. Aggregate ()This MongoDB command helps process the data, which returns the calculated result. This can group values from multiple documents together.
2. ReplicationReplication in MongoDB is achieved using a replication set. A replica set is a group of MongoDB processes with the same dataset. Replica set provides:
High availability
Redundancy hence faults tolerant/disaster recovery.
In replica, one node is the primary node, and the rest are the secondary node. All write operations remain with the primary node.
Let’s see; you can convert a standalone MongoDB instance into a replica set.
Here are the steps for that:
Close is already running the MongoDB server.
Now Start the MongoDB server by specifying — replSet option.
Syntax:
3. Create & restore BackupTo create the Backup, the mongodump command is used. The server’s data will be dumped into a dump directory(/bin/dump/). Options are there to limit the data.
To restore a backup in MongoDB, you would use the “mongorestore” command.
4. Monitor DeploymentTo check the status of all your running processes/instances, a mongostat command is helpful. It tracks and returns the counter of database operations. These counters include inserts, updates, queries, deletes, and cursors. This MongoDB command is beneficial as it shows your status about low running memory, some performance issues, etc.
You must go to your MongoDB installation bin directory and run mongostat.
Tips and Tricks to Use MongoDB Commands
Pre-allocate space: When you know your Document will grow to a certain size. This is an optimization technique in MongoDB. Insert a document and add a garbage field.
Try fetching data in a single query.
As MongoDB is, by default, case sensitive.
Example:
db.people.find({name: ‘Russell’}) &
db.people.find({name: ‘russell’}) are different.
While performing a search, it’s a good habit to use regex. Like:
db.people.find({name: /russell/i})
Prefer Odd No. of Replica Sets: Using replica sets is an easy way to add redundancy and enhance read performance. All nodes replicate the data, and it can be retrieved in case of a primary node failure. They vote amongst themselves and elect a primary node. Using the odd number of the replica will make voting more accessible in case of failure.
Secure MongoDB using a firewall: As MongoDB itself doesn’t provide any authentication, it’s better to secure it with a firewall and mapping it to the correct interface.
No joins: MongoDB, a NoSQL database, does not support joins. One must write multiple queries to retrieve data from more than two collections. Writing queries can become hectic if the schema is not well organized. This may result in the re-designing of the schema. It’s always better to spend some extra time to design a schema.
ConclusionMongoDB commands are the best practice solution to maintain high availability, efficient and scalable operations, which is today’s business demand.
Recommended ArticlesUpdate the detailed information about How To Create, Alter, Delete Database In Mongodb on the Kientrucdochoi.com website. We hope the article's content will meet your needs, and we will regularly update the information to provide you with the fastest and most accurate information. Have a great day!