MongoDB is a product between relational database and non relational database, and is the most powerful and relational database in the relational database.
The supported data structure is very loose and is a JSON-like Bjson format, so you can store more complex data types.
MONGO the most characteristic is that he supports the query language is very powerful, its syntax is similar to the object-oriented query language, almost can achieve similar relat
MongoDB provides a C # development interface, starting with the download, then inserting, querying, updating.Start the MongoDB service first.Download Http://github.com/mongodb/mongo-csharp-driver/downloads. Each version will have two drive modes, one is. msi and one is. zip.vs:2013,
MongoDB C # Driver (driver) IntroductionThere are currently two types of MongoDB drivers based on C #, namely the official drive () and the Samus driver ().This time we only demonstrate the official drive usage.Official Drive Document ViewFirst step: referencing the driver DLLThere are two ways to refer to drivers:1. D
Big Data Architecture Development mining analysis Hadoop HBase Hive Storm Spark Flume ZooKeeper Kafka Redis MongoDB Java cloud computing machine learning video tutorial, flumekafkastorm
Training big data architecture development, mining and analysis!
From basic to advanced, one-on-one training! Full technical guidance! [Technical QQ: 2937765541]
Get the big data video
Create a directory as follows
Extract the MongoDB compressed package into the MongoDB directory
Mongodata Create the Data directory to store the information; Create the log directory to store the directory
CMD input command:
D:\mongo\mongodb\bin\mongod.exe--dbpath "D:\mongo\mongodata\data"--logpath "D:\mongo\mongodata\log\MongoDB.log"- -install--service
.
Start MongoDB:
$ mkdir-p ~/usr/mo_data
$ CD ~/usr/mongo/bin
$./mongo--dbpath= $HOME/usr/mo_data
Write a simple little program to test the generated libmongoclient.a.
#include #include "Client/dbclient.h"
using namespace MONGO;
void Run () {
Dbclientconnection C;
C.connect ("localhost");
}
int main () {
try {
Run ();
cout catch (Dbexception E) {
cout }
return 0;
}
$ g++ mon2.cpp-i ~/usr/mongo/include
Tag: Date writing C # IDF DFS aggregation replace network Apr
MongoDB is a document-oriented database that is simple and easy to operate.
You can set the index of any property in the MongoDB record (for example: Firstname= "Sameer", address= "8 Gandhi Road") for faster sorting.
You can create data mirroring either locally or on the network, which
C #-based MongoDB database development and application (4)-Redis installation and use,
I have introduced three articles about MongoDB database development and usage. Strictly speaking, this article cannot be classified into MongoDB database development. However, Redis is closely related to
1. Review: The previous study of MongoDB's basic command learning
2. This article will learn to use the MongoDB C # drivers to implement add-delete and check
3. Preparation:
3.1 C # drivers support situation
In the face of the current learning, we still use the Version2.0 version, because it supports all of the. NET, because the technology is more and more m
Training Big Data architecture development, mining and analysis!from zero-based to advanced, one-to-one training! [Technical qq:2937765541]--------------------------------------------------------------------------------------------------------------- ----------------------------Course System:get video material and training answer technical support addressCourse Presentation ( Big Data technology is very wide, has been online for you training solutions!) ):Get video material and training answer
1: Brief Introduction
MongoDB is a distributed document database that supports a master-slave structure similar to a relational database. It stores documents in binary Json format, without locks, transactions, and indexes.
2: Installation Steps
Step 1: Download the Assembly http://www.mongodb.org/downloads
Part 2: extract and extract the relevant bin directory to C: \ Mongo (this option is optional), and cr
, $pull, $slice, $addToSet, etc.
MongoDB can automatically establish an Multikey index for an array element
17 An inline document document can be used as the value of a key in a document. The total size of the MongoDB document is limited to 16MB, it is recommended to use the form of sub-documents to organize the data, sub-document query efficiency is higher than the multi-key query.{"_id": ObjectId
below we'll cover a few simple and common update operations.If we need to update an object (which might be 0 if the condition does not match), you can use the Updateoneasync method and execute the filter and the document that needs to be updated, such as below we will "counter" the "counter" in the data for 1 is updated to 110:var filter = Builders"counter"1); var updated = Builders"counter"); var result = collection. Updateoneasync (filter, updated). Result;If we need a batch update, we can ca
1. Basic query:
Constructs query data.
Copy Code code as follows:
> Db.test.findOne ()
{
"_id": ObjectId ("4fd58ecbb9ac507e96276f1a"),
"Name": "Stephen",
"Age": 35,
"Genda": "Male",
"Email": "stephen@hotmail.com"
}
--Multi-condition query. The following example is equivalent to the WHERE name = "Stephen" and age = 35 of the SQL statement
> Db.test.find ({"Name": "Stephen", "Age": 35})
{"_id": ObjectId ("4fd58ecbb9ac507e96276f1a"), "name": "Stephen", "Age": "Genda": "Male"
Recently in writing a small thing, need to save some pictures, I used the FTP or direct database to save files, with FTP to save the file feel more trouble, with the database bar, but also to change the field type, modify code, modify query statements, too lazy to change.Have seen Mongondb's article, with the intention to use Mongon to store files, and then plan to take a look at Baidu, C # operation MongoDB
placed in the GridfspublicvoidLoadFileInGridFS(stringstring fileName){ Mg_db = mongoServer.GetDatabase(dbName); MongoGridFS gridfs = Mg_db.GridFS; gridfs.Download(fileName);}Take out the data placed in the Gridfs and save it in byte[]publicbyteReadFileFromfs(stringstringbyte[] bytes){ Mg_db = mongoServer.GetDatabase(dbName); MongoGridFS gridfs = Mg_db.GridFS; MongoGridFSStream gridFileStream = gridfs.OpenRead(fileName); newbyte[gridFileStream.Length]; 0, bytes.Length);
documentMongoDB has a lot of update operations, and below we'll cover a few simple and common update operations.If we need to update an object (which might be 0 if the condition does not match), you can use the Updateoneasync method and execute the filter and the document that needs to be updated, such as below we will "counter" the "counter" in the data for 1 is updated to 110:var filter = Builders"counter1"); var updated = Builders"counter"); var result = collection. Updateoneasync (filter,
. Deletemanyasync (expression); the } - $ the /// the ///Delete a the /// the Public Static voidDeleteone ThisImongocollectionBOOL>> expression)whereT:imongomodel - { in if(Expression = =NULL) {Throw NewArgumentNullException ("Invalid parameter"); } the collenction. Deleteoneasync (expression); the } About } the}Imongomodel:1 usingMongodb.bson;2 usingSystem;3 usingSystem.Collections.Generic;4 usingSystem.Text;5 6 namesp
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.