Skip to content
    • info@hktsoft.net
  • Connecting and sharing with us
  • Login
  • About Us
    • info@hktsoft.net
HKT SOFTHKT SOFT
  • Home
  • Programming Languages
    • Popular Programming Languages
      • Core Java
      • JavaScript
      • Advanced Java
      • C
      • C#
      • C++
      • Python
      • PHP
      • HTML
      • CSS
    • Other Programming Languages
      • GitHub
      • Bootstrap
      • AngularJS
      • jQuery
      • MongoDB
      • NodeJS
      • Unix & Linux
    • Database
      • Basic Database
      • SQL
      • SQL Server
      • Data structures and algorithms
    • Website
      • WordPress
      • Joomla
      • Magento
      • Opencart
  • Corporate Management
    • Entrepreneurship
      • Startup
      • Entrepreneurship
      • Management Science
    • Managing primary activities
      • Marketing
      • Sales management
      • Retail management
      • Import – Export
      • International business
      • E-commerce
      • Project management
      • Product Management
      • Quality Management
      • Logistics Management
      • Supply Chain Management
    • Managing support activities
      • Strategy
      • Human Resource Management
      • Organizational Culture
      • Information System
      • Corporate Finance
      • Stock Market
      • Accounting
      • Office Management
  • Scientific Theories
    • Economic Theories
    • Social Theories
    • Political Theories
    • Philosophies
    • Theology
    • Art Movements
Using a Java Client with MongoDB: Setting Up the Environment

We need to download and install the following software. MongoDB 3.0.5 binary distribution mongodb-win32-x86_64-3.0.5-signed.msi from mongodb.org/downloads. Stable Release (3.0.5) for Windows 64-bit is used in this chapter. Eclipse IDE for Java EE Developers from eclipse.org/downloads. Java 5 or later (Java 7 used) from oracle.com/technetwork/java/javase/downloads/index.html. Double-click on the MongoDB binary distribution to install MongoDB. Add the [ [ ...]

01
Feb
Using a Java Client with MongoDB: Creating a Maven Project

To access MongoDB from a Java application we need to create a Maven project in Eclipse IDE and add the required dependencies. Select File ► New ► Other. In the New window, select the Maven ► Maven Project wizard and click on Next as shown in Figure 1-2.  In New Maven Project wizard select the [ [ ...]

01
Feb
Using a Java Client with MongoDB: Creating a BSON Document

In this section we shall add a BSON (Binary JSON) document to MongoDB server. We shall use the CreateMongoDBDocument.java application in Eclipse IDE. A MongoDB document is represented with the org.bson.Document class. MongoDB stores data in collections. The main packages for MongoDB classes in the MongoDB Java driver are com.mongodb and com.mongodb.client. A MongoDB client [ [ ...]

01
Feb
Using a Java Client with MongoDB: Using a Model to Create a BSON Document

In the previous section we constructed the documents to add to a collection using the append(String key, Object value) method in Document class and added the documents to a collection using the insertOne(TDocument document) method in MongoCollection<TDocument> interface. A Document object may also be constructed using a model class that represents the objects in a [ [ ...]

01
Feb
Using a Java Client with MongoDB: Getting Data from MongoDB

In this section we shall fetch data from MongoDB. We shall use the MongoDBClient application in this section. The MongoCollection<TDocument> interface provides the overloaded methods discussed in Table 1-7 to find documents. Create a MongoClient instance, a MongoDatabase instance, and a MongoCollection<TDocument> instance as discussed earlier. MongoClient mongoClient = new MongoClient(Arrays.asList(new ServerAddress(“localhost”, 27017))); MongoDatabase db [ [ ...]

01
Feb
Using a Java Client with MongoDB: Updating Data in MongoDB

In this section we shall update MongoDB data. We shall be using the UpdateDBDocument application. The MongoCollection<TDocument> class provides several methods, some of them overloaded, to find and update data as discussed in Table 1-8. Some of the methods listed support only update operators in the update document. The update operators that may be applied [ [ ...]

01
Feb
Using a Java Client with MongoDB: Deleting Data in MongoDB

In this section we shall delete documents using the DeleteDBDocument application. The MongoCollection<TDocument> interface provides several methods for deleting documents as discussed in Table 1-10. In the DeleteDBDocument application create a MongoClient client as discussed previously. Create a MongoDatabase instance for the local database from the MongoClient instance and create a MongoCollection<TDocument> instance for the [ [ ...]

01
Feb
Using the Mongo Shell: Getting Started

In the following subsections we shall set up the environment including installing the required software. We shall start Mongo shell and connect with MongoDB server. And we will also discuss running a command in Mongo shell. 1. Setting Up the Environment Download and install the following software if not already installed from Chapter 1: MongoDB [ [ ...]

01
Feb
Using the Mongo Shell: Using Databases

In the following subsections we shall discuss getting information about a database, creating a database, and dropping a database. 1. Getting Databases Information The Mongo shell has a variable called db, which references the current database. By default when the Mongo shell is started using the mongo command the test database becomes the current database [ [ ...]

01
Feb
Using the Mongo Shell: Using Collections

In the following subsections we shall create a collection and subsequently drop a collection from the Mongo shell. 1. Creating a Collection The create command is used to create a collection. We already discussed the create command to create a collection (see “Running a Command or Method in mongo Shell”). The show collections command may [ [ ...]

01
Feb
Using the Mongo Shell: Using Documents

In the following subsections we shall discuss adding a document, adding documents in a batch, querying a document, updating a document, and removing a document. 1. Adding a Document In this section we shall use the db.collection.insert() JavaScript method to add a document to MongoDB from Mongo shell. The insert() helper method has a different [ [ ...]

01
Feb
Using MongoDB with PHP: Getting Started

In the following subsections we shall discuss the PHP MongoDB Database Driver. We also discuss setting up the environment and creating a connection to MongoDB Driver from a PHP script. 1. Overview of the PHP MongoDB Database Driver The PHP MongoDB Driver provides several classes for connecting to MongoDB and performing CRUD operations. The core [ [ ...]

02
Feb
Using MongoDB with PHP: Using Collections

In subsequent subsections we shall discuss getting a collection and dropping a collection using the PHP MongoDB Driver. 1. Getting a Collection In this section we shall create a collection in a MongoDB database instance. Create a PHP script collection.php in the C:\php directory. The MongoCollection class represents a collection. The syntax to get a [ [ ...]

02
Feb
Using MongoDB with PHP: Using Documents

In the following subsections we shall discuss adding, querying, updating, and deleting a document in MongoDB server using the PHP MongoDB Driver. 1. Adding a Document The MongoCollection::insert method is used to add a single document to MongoDB. The insert() method takes parameters. MongoCollection::insert ( array|object $document [, array $options = array() ] ) The [ [ ...]

02
Feb
Using MongoDB with Ruby: Getting Started

In the following subsections we shall introduce the Ruby Driver for MongoDB, and set up the environment with the required software. 1. Overview of the Ruby Driver for MongoDB The Ruby driver for MongoDB API may be used in a Ruby script to connect to MongoDB Server and perform CRUD (create, read, update, and delete) [ [ ...]

02
Feb
Using MongoDB with Ruby: Using a Collection

In the following subsections we shall connect to MongoDB server, get database information, and create a collection. 1. Creating a Connection with MongoDB In this section we shall connect with MongoDB Server using a Ruby script. Create a directory called C:\Ruby21-x64\mongodbscripts for Ruby scripts. Create a Ruby script connection.rb in the C:\Ruby21-x64\mongodbscripts directory. In the [ [ ...]

02
Feb
Using MongoDB with Ruby: Using Documents

In the following subsections we shall add a document to MongoDB server, add a batch of documents, find a single document, find multiple documents, update documents, delete documents, and perform bulk operations. 1. Adding a Document In this section we shall add a single document to a MongoDB collection. The insert_one(document, options = {}) method [ [ ...]

02
Feb
Using MongoDB with Node.js: Getting Started

In the following subsections we shall introduce the Node.js driver for MongoDB and set up the environment. 1. Overview of Node.js Driver for MongoDB The Node.js driver for MongoDB provides an API to connect to MongoDB server and perform different operations in the server such as adding a document or finding a document. The main [ [ ...]

02
Feb
Using MongoDB with Node.js: Using a Connection

In the following subsections we shall create a connection with MongoDB server and create a database instance. 1. Creating a MongoDB Connection In this section we shall connect to MongoDB server using the Node.js driver for MongoDB. We shall use the MongoClient class for connecting to MongoDB server. The MongoClient constructor does not take any [ [ ...]

02
Feb
Using MongoDB with Node.js: Using Documents

In the following subsections we shall add a document, add a batch of documents, query documents, update documents, delete documents, and run bulk operations on documents. 1. Adding a Single Document In this section we shall add a document to a MongoDB collection. First, create a collection called catalog in the local database using the [ [ ...]

02
Feb
  • 1
  • 2
  • 3
  • 4
Corporate Management
  • Firm Strategy and Strategic ManagementFirm Strategy and Strategic Management
  • Marketing and Corporate BrandingMarketing and Corporate Branding
  • Production Management : Definition, Function and ScopeProduction Management : Definition, Function and Scope
  • Corporate accounting: definition, functions and branchesCorporate accounting: definition, functions and branches
  • Logistics Management: meaning, functions, importance, process and best practicesLogistics Management: meaning, functions, importance, process and best practices
  • Entrepreneurship and StartupEntrepreneurship and Startup

Scientific Theories
  • Economic Theories and ConceptsEconomic Theories and Concepts
  • Political Theories and ConceptsPolitical Theories and Concepts
  • Social Theories and ConceptsSocial Theories and Concepts
  • Great Thinkers and their Big IdeasGreat Thinkers and their Big Ideas
  • List of Art movementsList of Art movements
  • Philosophical Theories and ConceptPhilosophical Theories and Concept

Hãy ủng hộ và đồng hành cùng chúng tôi

... trong chia sẻ và phổ biến kiến thức bằng các hành động thiết thực và hoàn toàn miễn phí của bạn.

hotlineTThảo luận đóng góp ý kiến

Nhiệt tình tham gia thảo luận và nêu ý kiến đóng góp, kinh nghiệm thực tế của bạn qua từng bài viết, videos trên website của chúng tôi.

hỗ trợ hkt Chia sẻ có bản quyền

Hãy cập nhật và chia sẻ rộng rãi các bài viết, videos có ghi rõ nguồn của chúng tôi trên Facebook và các kênh thông tin của bạn.

hỗ trợ hkt Đăng ký và likes bài viết, videos

Ủng hộ chúng tôi về tinh thần và bằng những hành động thiết thực và hoàn toàn miễn phí của các bạn trên kênh thông tin của chúng tôi.

HKT Soft

About HKT CHANNEL
About HKT CONSULTANT

Website Structure

Java & JavaScript ,  C & C# & C++,  Python
PHP,  HTML,  CSS, GitHub,   Bootstrap,   Unix & Lunix
Database,  SQL,  SQL Server, Data structures and algorithms 

HKT Consultant JSC.

      "Knowledge - Experience - Success"
- Email: Info@hktsoft.net
- Website:
hktsoft.net

  • Home
  • Programming Languages
    • Popular Programming Languages
      • Core Java
      • JavaScript
      • Advanced Java
      • C
      • C#
      • C++
      • Python
      • PHP
      • HTML
      • CSS
    • Other Programming Languages
      • GitHub
      • Bootstrap
      • AngularJS
      • jQuery
      • MongoDB
      • NodeJS
      • Unix & Linux
    • Database
      • Basic Database
      • SQL
      • SQL Server
      • Data structures and algorithms
    • Website
      • WordPress
      • Joomla
      • Magento
      • Opencart
  • Corporate Management
    • Entrepreneurship
      • Startup
      • Entrepreneurship
      • Management Science
    • Managing primary activities
      • Marketing
      • Sales management
      • Retail management
      • Import – Export
      • International business
      • E-commerce
      • Project management
      • Product Management
      • Quality Management
      • Logistics Management
      • Supply Chain Management
    • Managing support activities
      • Strategy
      • Human Resource Management
      • Organizational Culture
      • Information System
      • Corporate Finance
      • Stock Market
      • Accounting
      • Office Management
  • Scientific Theories
    • Economic Theories
    • Social Theories
    • Political Theories
    • Philosophies
    • Theology
    • Art Movements
  • About-Us

Login

Lost your password?