The Java source code for the application can be downloaded from the Download section below. The code runs from the terminal or from an IDE like IntelliJ Idea. The app connects to MongoDB Server v4.2.8. The application is written using Java SE 8 and MongoDB Java Driver v3.12.2. The user can enter data interactively and get the result of the database operation. The user can select an option to perform a task - a CRUD operation. It has a menu as shown in the screenshot below. This application is command-line program, runs from the OS terminal. In addition to connection, the driver also converts the data from the client format to the BSON stored on the database server, and vice-versa. For Java applications it is the MongoDB Java Driver. The client program connects to the database server via a driver. A client can also be an application developed using a programming language like Java, Python or NodeJS platform. mongo shell, the command-line tool is included with the database, is commonly used to perform administrative and data related tasks. The standard way to connect to the MongoDB server is from a client application.
These are an extension to JSON which provide additional data types like date, various numeric types, etc., in addition to the JSON string, boolean, number, array and object types. The data stored in the database is BSON (binary JSON) types.
The document data is similar to JSON in structure, with fields defined as key value pairs. These are analogous to database, table and row in SQL and tabular database system. Data is stored in databases, collections and documents. MongoDB is a NoSQL document based database. This is an example Java application with a command-line user interface to perform CRUD operations (Create Read Update Delete) on MongoDB database.