The following example inserts a user object into the MongoDB and reads it
The code is as follows
Copy Code
user.java: Package Com.mongo; public class User { string name; int age; oid _id; public String G
MongoDB want to integrate PHP, need to install MONGO extension, this is relatively simple, now say MongoDB Phpapi and usageLet's look at a simple example:
PHP code
1.
2. $m = new Mongo (); This is the default connection to the local 27017 port,
1, Wget-q http://peak.telecommunity.com/dist/ez_setup.py
2. Execute ez_setup.py Script
The code is as follows
Copy Code
Python ez_setup.py
3, sudo easy_install Pymongo
Here's a small example:
1. Download Linux version of MongoDB database
Download the MongoDB Linux version to the official download page, 32-bit or 64-bit to choose from their own situation
Http://www.mongodb.org/downloads
or download directly from the server using wget
The production environment instance frequently OOM, the investigation discovery mainly by some $near query causes, the query resembles follows, in which the LATLNG field has established 2d index.
{"Find": "UserData",' Filter ': {"LATLNG": {"$near":
MongoDB is a nosql type of database, high-performance, easy to deploy, easy to use features in the IT industry is very popular.The following describes the installation of MongoDB, here we are installed under Linux, using the centos6.4 64-bit, you
Mongodb:There are collections and document conceptsCollection = = TableDocument = = rows in the database table!! Database Creation (BOSENRU)> Use BOSENRU;Switched to DB Bosenru!! Insert a table (T1) into the Bosenrui, insert (x:1) This field (X is
The previous article introduced the MongoDB additions and deletions to change the basic usage of the command, this article to learn some of MongoDB's basic aggregation functions.Here we go straight to the topic, with a simple example to introduce in
MongoDB access control can effectively ensure the security of the database, access control refers to the binding application listening IP address, set the listening port, using the account and password loginOne, the parameters of the access control1,
1. Download MongoDBOfficial website: https://www.mongodb.org/downloadsSpecific Link: https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-3.2.10.tgzDownload the file to the specified location, for example, my downloaded file is placed in
1. Each database in a MongoDB instance can have many users. If security checks are turned on, only database authenticated users can perform read or write operations.In the context of authentication, MongoDB will treat the normal data as the admin
1. Query the document in the collection, you can use the command DB. Collection name. Find ({condition}), or use DB. Collection name. FindOne () query the first document2. Query the document in the collection to return some specific key values3.
Using MongoDB is not a lot, remember to do "parent assistant" time, used a little. It was only when I made the "dispatch system" last year that I used MongoDB again.Here is a brief introduction to the dispatch system, dispatch system in the Cloud
In a MongoDB database, the objects that create, query, update, and delete operations are collections.1. See which collections are in a database, before you use the databaseC:\Windows\system32>mongomongodb Shell version:3.2.TenConnecting to:
Installation:Short installation path D:MONGODB for subsequent operationConfiguration:1. Create a new Data folder and create a new DB and log folder under the Data folder with the following pathMongodb\data\dbMongodb\data\log2. Start the Mongod
The installation code is as follows:Tar-zxf mongodb-linux-x86_64-2.6.5.tgzMusic mongodb-linux-x86_64-2.6.5/usr/local/Cd/usr/localMusic mongodb-linux-x86_64-2.6.5 mongodb // Create a data directoryMkdir/data2/mongodbData// Create a log file (note
Now we use Java to operate MongoDB data.I. Preparations1. First, download the driver packages supported by mongoDB for Java.Driver Package download address: https://github.com/mongodb/mongo-java-driver/downloadsMongoDB Java-related support,
The official MongoDB is actually green without installation, http://www.mongodb.org/downloadsThe configuration file is not included by default. You can create one by yourself:Vi mongodb. conf: The code is as follows:Copy code Dbpath
Download required software (download to the/usr/local/src directory) The code is as follows:Copy code # Wget http://downloads.mongodb.org/src/mongodb-src-r1.8.1.tar.gz# Wget http://ftp.mozilla.org/pub/mozilla.org/js/js-1.7.0.tar.gz# Wget
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.