1. PrefaceIn the previous article, we introduced MongoDB. Now, let's look at how to do a regular crud operation in MongoDB. After all, as a storage system, it is the basic function of the data to be increased and censored operation.The additions and
I. Initial knowledge of MONGODBMongoDB is a database based on distributed file storage. Written by the C + + language. Designed to provide scalable, high-performance data storage solutions for WEB applications.MongoDB is a product between a
OverviewMongoDB provides clients the ability to perform write operations in bulk. Bulk write operations affect a single collection. MongoDB allows applications to determine the acceptable level of acknowledgement required for bulk write
One installation of MongoDB
Download, install and one step on-demand website.Two vs Create a new project
Create a. Netcore console project, and then nuget to install the driver Mongodb.driverThree Establish connections
Adding code in the
Directory
First, preface
(i) Operating environment
Second, pre-preparatory work
(i) Create Mongodbcontext MongoDB operation Context Class
(ii) Creation of test classes
(iii) Create test code
First, insert the documentUsing the Insert method to insert a document into a collection, there are several ways to create a collection if the collection does not exist:
Db.collection.insertOne ({}): (v3.2 new) #插入一个文档到集合中
>
MongoDB is based on crud (Create,read,update,delete) method to implement the collection of documents on the increase and deletion of the search. For the additions and deletions of the fields on the collection, you can use set or unset modifiers to
The 3.x version of MongoDB's Java driver has a completely new design compared to 2.x, and there is a big difference between class libraries and usage methods. For example, replacing basicdbobject with document, using builders class to build Bson
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.