In the recent study of Nodejs, here are some APIs that use mongoose to manipulate MongoDB.
Prelude:
1. Installation of Mongoose:var Mongoose = require (' Mongoose ');
2. Connecting Mongodb:mongoose.connect (' Mongodb://localhost/nodejs ');
3.
Find it more and more lazy recently ... One months an article--!
Environment: Windows 7, IIS7, php5.3.5, MongoDB 2.6
The overall steps are:
Install
MongoDB, install the MongoDB extension of PHP, and install MongoDB as a service.
= = = Installation, Configuration = = =
The code is as follows
Copy Code
#下载源码包Cd/usr/local/src/mongodbWget-c http://fastdl.mongodb.org/linux/mongodb-linux-x86_64-2.2.7.tgz #解压, copy the bin folder to the specified
--Install MONGOOperating system for Centos x64Download the. tar.gz file at the official website
The code is as follows
Copy Code
cd/data/Http://fastdl.mongodb.org/linux/mongodb-linux-x86_64-2.4.3.tgzTar zxf mongodb-linux-
First enable the MongoDB HttpinterfaceModify Mongodb.confComment this row
The code is as follows
Copy Code
#nohttpinterface = True
Httpinterface Port is MongoDB Port +1000If the default port for MongoDB is 27018
MongoDB official Java driver, save and read, the need is DBObject object, this is an interface, implementation put,get and other methods, similar to map, if we want to directly save ordinary Java objects to MongoDB, It needs to be converted into
MongoDB installation, download the desired version of the official website, Visual Tools Mongovue (note does not support the mongodb3.0 above version)Download MIS installation, unzip after bin, ...1. Configure the environment variable to add the
Tag: Push data sharing unsafe time format automatically deletes class init data typeIn the project, the date type is created in MONGO, and the MONGO set expiration is automatically deleted based on the date type. and the date type in MONGO, using
-------------------mongodb Corresponding SQL statement-------------------1, Create and alter 1, sql: CREATE TABLE users ( ID mediuminty not NULL auto_increment, &N Bsp user_id varchar (+), Age number,
Operations for manual shardingAutomatic sharding can result in degraded performance. Therefore, it is reasonable to use manual shards. and use with tag together.# for 4 shard programs, pre-processed instructions1. Join the Shard serverSh.addshard ("1
Preface:As the Columnstore concept matures, more and more developers are embracing mongodb,hbase, a large-storage, distributed, Columnstore database. In particular, MongoDB's rapid construction, the rapid use of features, so that it gets more people'
Inserting some data into the student collectionDb.student.insert ({"Study No.": 10010, "name": "De Levin", "Age": 26, "Address": "Zibo"}), var studata1={"study number": 10020, "name": "Obama", "age": 27, "Address": "Azeroth"};d B.student.insert
MongoDB Unauthorized Access VulnerabilityCatalogue1. mongodb安装2. 未授权访问漏洞3. 漏洞修复及加固4. 自动化检测点1. MongoDB InstallationApt-get Install MongoDB0x1: Creating a database DirectoryMongoDB data is stored in the DB directory in the database directory, but this
1. Export Database/backup:@echo offf:cd F:\software1\mongdb\mongodb-win32-x86_64-3.0. 0 127.0. 0.1:27017 -D db-o F:\software1\mongdbDo not explain, modify the path information can be used directly;2. Restore the backed up database:@echo offf:cd
1. IntroductionMaster-slave replication is the most common way to replicate MongoDB. This method is very flexible and can be used for backup, failure recovery, read scaling, and so on.The most basic way to set up is to establish a master node and
MMAPV1 is the default storage engine of MongoDB before 3.2, after 3.2 The default storage engine is based on memory-mapped files for the WIREDTIGER,MMAPV1 storage engine, which specializes in high-capacity inserts, reads, and updates.JournalTo
After the successful start of MongoDB, and then open a command line window input MONGO, you can do some of the database operations.Enter help to see the basic Operations Command:Show DBS: Display Database listShow Collections: Displays a collection
CRUD operations Create, read, update, and delete documents.Create OperationsCreate or Insert operations Add new documents to a collection. If The collection does not currently exist, insert operations would create the collection.MongoDB provides the
0x00 MongoDB permissions1. No parameters are added during MongoDB installation. By default, no permission verification is performed. Login users can perform any operations on the database and remotely access the database. The parameter-auth must be
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.