The production environment uses the MONGO database.Long-coveted for the MONGO database, its high performance/open source/modeless/document-based database/... What a tempting feature, also occasionally tossing and playing, but did not make notes,
Try to use the MONGO model in thinkphp today and find out that there will always be an errorCall to a member function selectcollection () on a non-objectFor a reason, it was found that the configuration file was not imported, resulting in the
********************************** Connect to the MongoDB database * * ************************* format ("mongodb: username: password @ address: Specifies the database by default on the port ", parameter) $ connnewMongo (); can be abbreviated as $
: This article mainly introduces the PHP MongoDB learning notes. if you are interested in the PHP Tutorial, you can refer to them.
/*** PHP MongoDB learning Notes*///*************************// ** Connect to the MongoDB database **////*************
2, install (Windows only)Download the corresponding package to the official websiteExtract to D:mongodbCreate d:mongodbdata Drop Data file
3, Run MongoDBD:mongodbbin There are executable files, where Mongod.exe is the server side, Mongo.exe is the
Recently there is a project, need to use PHP to manipulate MONGODB data, organized as follows 1, connected to the MongoDB database
$conn = new Mongo (); Other link methods//$conn =new Mongo (); #连接本地主机, default port.//$conn =new
I. Mongodb introduction Mongo (www.mongodb.org) is a high-performance, open-source (DAI zhenjun daniu is studying Mongodb source code. You can go to www. cnblogs. comdaizhj), schema-free document-type database, which can be used in many scenarios to
To use MongoDB, You need to import the following classes, not all of which are required.Import com. MongoDB. Mongo;Import com. MongoDB. dB;Import com. MongoDB. dbcollection;Import com. MongoDB. basicdbobject;Import com. MongoDB. dbobject;Import com.
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.