MongoDB study notes (2) realize basic data operation through samus driver
1. About the driver of MongoDB MongoDB supports drivers in multiple languages, and we only introduce C# drivers here. There are many kinds of C# drivers, and the form of each driver is roughly the same, but the details are different, so the code cannot be used universally. The more commonly used ones are the official driver and the samus driver. In addition to supporting general forms of operations, the samus driver also supports linq to manipulate data. Everyone prefers this way. Official driver download address: Click to download Samus driver download address: Click to download This article will start with the samus driver to explain database access, international practices, and access to “Hello World!”. 2. Realize HelloWorld access through the samus driver Before performing the following operations, please make sure that the MongoDB service has been started. If you don’t know how to start the service, please read the previous article. Download the driver, create a new console project, and add a reference to MongoDB.dll. If you downloaded the driver source code, just compile and reference the generated DLL. The basic code is as follows: 1 2 3 4 5 6 7 8 9 10 11 12 13 14…