![]() ![]() Documents are analogous to JSON objects but exist in the database in a more type-rich format known as BSON. The best way to think of a document is as a multidimensional array.Ī document contains a set of fields or key-value pairs. In an array, you have a set of keys that map to values (Document = Array). MongoDB runs on most platforms and supports 32-bit and 64-bit architectures. MongoDB is available as a binary, or as a package. In production environments, use 64-bit MongoDB binaries. This section will cover installation on Ubuntu Linux and Windows. For other operating systems, please see their documentation. Open terminal and execute the following: sudo apt-key adv -keyserver hkp://:80 -recv 7F0CEB10Įcho 'deb dist 10gen' | sudo tee /etc/apt//mongodb.list This is how Mongo is installed on Ubuntu Linux. Now issue the following command to update your repository and install the latest stable version of MongoDB: sudo apt-get updateĭone, you have successfully installed MongoDB. The following describes how to install it on Windows: In case of start error to try run the following command: sudo mongod -fork -logpath /var/log/mongodb/mongodb.log DOWNLOAD MONGODB WHICH FILE OPEN UPDATE Head on over to the downloads page on the MongoDB official website. Click on the download link for the latest stable release under Windows.Īfter the download is finished, extract and move it into C:\. ![]() MongoDB requires a data folder in which to store its files. The default location for the MongoDB data directory is C:\data\db. To start MongoDB, execute from the Command Prompt C:\> cd \mongodb\binĭone, you have successfully installed MongoDB. Now start and stop service MongoDB via command line below. The MongoDB server is built to already work with your current web server, but not PHP. If you use Linux install it easily via: sudo pecl install mongoĪdd the line extension=mongo.so to your php.ini configuration and you’re good to go: sudo -iĮcho 'extension=mongo.so' > /etc/php5/apache2/php.ini To make PHP talk to the MongoDB server, we are going to need the PHP-MongoDB driver. Let us try installing the driver on a Windows machine running PHP 5.4 on Apache (XAMPP): Restart your web server and verify via command line: php -i |grep "mongo" DOWNLOAD MONGODB WHICH FILE OPEN INSTALL
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |