JIYIK CN >

Current Location:Home > Learning > DATABASE >

All

Batch update documents in MongoDB using Java

Publish Date:2025/04/29 Author:JIYIK Category:MongoDB

This article is about performing bulk updates of documents in MongoDB using the Java driver. We will also learn how to update by adding new fields, changing the value of an existing field or array, or deleting documents. Prerequisites For t...

Full

Get the last N records in MongoDB

Publish Date:2025/04/29 Author:JIYIK Category:MongoDB

This article will explore the number of ways to get the last N records in MongoDB, where N is a positive number greater than zero. We will see how to retrieve the number of documents with and without sorting. Get the last N records in Mongo...

Full

A query similar to the SQL LIKE statement in MongoDB

Publish Date:2025/04/29 Author:JIYIK Category:MongoDB

MongoDB is a powerful NoSQL database server. It uses JSON-like documents with optional schema to store data. Organizing data is always an essential task for developers as it plays the most critical role in the performance of the application...

Full

Create a MongoDB dump of the database

Publish Date:2025/04/29 Author:JIYIK Category:MongoDB

In this MongoDB article, you’ll get a walkthrough of Mongodump and Mongorestore , how to use them, and some simple examples of backing up and restoring your collections using both tools. mongodump Commands in MongoDB Mongodump is a tool t...

Full

Using findOneAndUpdate() method in MongoDB

Publish Date:2025/04/28 Author:JIYIK Category:MongoDB

This article will introduce the findOneAndUpdate() method in MongoDB. We will use this method to update the first matching and embedded document. Using findOneAndUpdate() method in MongoDB db.collection.findOneAndUpdate() Method updates the...

Full

MongoDB truncate collection

Publish Date:2025/04/28 Author:JIYIK Category:MongoDB

A collection is nothing but a folder that contains all the documents. When using capped collections, there is a cap on the number of records you can add to the collection. The maximum size of a document is 16MB. Sometimes you want to build...

Full

Add a new field to each document in a MongoDB collection

Publish Date:2025/04/28 Author:JIYIK Category:MongoDB

This article will discuss the $set and $setOnInsert operations. In addition, the issue of adding fields to a collection in MongoDB is also briefly explained using these two operators. $set operator in MongoDB The $set operator changes the v...

Full

Clear or delete a collection in MongoDB

Publish Date:2025/04/28 Author:JIYIK Category:MongoDB

This article will discuss the issue of deleting collections in MongoDB. The following are different ways to delete collections in MongoDB. MongoDB delete collection There are two ways to delete a collection in MongoDB. After running the dro...

Full

Autoincrement in MongoDB

Publish Date:2025/04/28 Author:JIYIK Category:MongoDB

Most SQL query languages ​​include a keyword for making a field auto-increment, but in MongoDB it is a bit more complicated. In MongoDB, there is no keyword for auto-increment. This article will show us how to insert data in MongoDB col...

Full

Composite Indexes in MongoDB

Publish Date:2025/04/28 Author:JIYIK Category:MongoDB

Sometimes we need to create an index that contains multiple fields. For example, if your document contains a field called Sex, it may contain two other fields, such as Male and Female. These fields may have values ​​like Yes or No. In t...

Full

Sparse Indexes in MongoDB

Publish Date:2025/04/28 Author:JIYIK Category:MongoDB

In MongoDB, it is not mandatory for all documents to contain the same fields. Now, if you want to get all the documents in a MongoDB collection that contain only a specific field, then you may need to specify a common field as an index. Thi...

Full

Creating Indexes in MongoDB

Publish Date:2025/04/28 Author:JIYIK Category:MongoDB

Indexes help resolve queries efficiently. Without indexes, MongoDB must iterate through every document in the collection to find the documents that match the query. It will waste time and require MongoDB to handle such information. Therefor...

Full

Unique Index in MongoDB

Publish Date:2025/04/28 Author:JIYIK Category:MongoDB

In this article, you'll learn about unique indexes, including what they are and how to create them in MongoDB. Additionally, the process of making a user's email unique in MongoDB is briefly described. The contents of this article are as fo...

Full

Locking mechanism in MongoDB

Publish Date:2025/04/28 Author:JIYIK Category:MongoDB

In database management systems, locking mechanisms ensure the consistency of the entire result. For example, if some writing process is in progress on the data, a read command cannot be executed at the same time. Database resources are lock...

Full

Using ORM with MongoDB

Publish Date:2025/04/28 Author:JIYIK Category:MongoDB

MongoDB introduces a NoSQL solution for data storage and management, consisting of documents represented in JSON style. Like other database systems, MongoDB can also use ORM. In this article, we will explain the concepts of ORM and general...

Full

Scan to Read All Tech Tutorials

Social Media
  • https://www.github.com/onmpw
  • qq:1244347461

Hottest

Tags

Scan the Code
Easier Access Tutorial