This week's study is mainly Nodejs database interaction, and using the Jade template to do a user-validated site. Mainly encountered a few problems.
1.mongodb version is too low
NPM err! Not compatible with your operating system or
These days the project revision, the time is comparatively tight, the blog also did not keep abreast, also hoped everybody forgive me.
Well, today sharing the basic operation of the index in the MongoDB, we do not avoid the day-to-day development
First run the Easy_install Pymongo command to install the Pymongo driver. Then do the action:Create a connection
Copy Code code as follows:
In [1]: Import Pymongo
In [2]: Connection = Pymongo. Connection (' localhost ', 27017)
First download the official address https://www.mongodb.com/download-center#communitySelect Windows Vista 32-bit, without SSL support i386 this versionInstallation option is the D drive bin path to D:\mongodb\binAfter the installation is
MongoDB Aggregation OperationsReading notesMongoDB, two kinds of computational aggregates pipeline and MapReducePipeline queries are faster than MapReduce, but MapReduce can execute complex aggregation logic on multiple servers in parallel.MongoDB
In this blog the procedure of MongoDB would be is described in details. It is known that MongoDB have provided a series of efficient solution to some different questions, such as high performance , changeable type and so on. Compared with the MySQL
This can be written in the MongoDB query statement {"A": $gt (1), "a": $lt (5)}But the value of this query will be matched by a single condition, and the end result is a collection of more than 1 +a less than 5.If you need to implement the
The recent period of time for MongoDB has been a simple learning from what is it? Do? How to use it? Advantages and Disadvantages This series of questions can now be used simply. I would like to have a brief summary and overview of it. Then this
We left a few questions in the last chapter.
1 whether the primary node can actively switch connections on its own ?
Need to switch manually now
2 master node read and write pressure too big how to solve
3 each of the above data from the
Recently used to $month and $dayofmonth These two commands, found a bit of a pit. The total feeling of the data and I look at the data from the database is not the same ...I found out the information on the Internet.The function $dayOfMonth is
Continue the learning of MongoDB--Index specific explanation--Index management--Spatial Index1. Create a simple index(1) Prepare 200,000 data firstfor (var i = 0;iDb.books.insert ("number": I, "name": i+ "book")}(2) Check the query performancevar
1, the first step is to download from the official website to match their operating system installation files or compressed files;2, just find a folder to unpack the installation files, and then in the C packing directory to create a new folder
1. Create a new folder for storing database files. It is recommended to put it in the folder of your own username and it will be much easier without sudo.Under the user's own username environment: mkdir [folder name]2. Go to the MongoDB Bin
The basic concept in MongoDB is a document, a collection, a databaseWith an example, some concepts in MONGO are more visually understood:Show DBS shows a list of all dataDB is the display of the current database object or collectionUse test to
1>, synchronization: Replication is used to back up data between multiple servers.The replication functionality of MongoDB is implemented using the log Oplog, the operations log contains each write operation of the master node.Oplog is a fixed
First, the index base:MongoDB's index is almost identical to the traditional relational database, which includes some basic optimization techniques. Here is the command to create the index:> Db.test.ensureIndex ({"username": 1})You can see whether
1. Create a CollectionThere are two ways to display create and implicitly createDisplay creation can use command Db.createcollection ("collection name")Implicit creation can use the command DB. Collection name. Insert ({}), which refers to creating
Next, I will talk about the group function of mongodb, which is quite powerful. It is quite complicated to use, such as find (), skip (), and distinct.Test data The code is as follows:Copy code > Db. fruit. find ();{"_ Id": 1, "category": "fruit"
By default, a _ id field is used as the autoincrement auto-increment implementation. The _ id field type is objectid (objectid is a 12-byte BSON type ). ObjectId.Now, due to database migration, some of the central mysql locations tables in the
$ Push: add an element to the document array. If this array is not available, the array is automatically added. The code is as follows:Copy code Db. users. insert ({"name": "zhang "})Db. users. update ({"name": "zhang" },{ "$ push": {"emails":
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.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service