Hiển thị các bài đăng có nhãn mongodb. Hiển thị tất cả bài đăng
Hiển thị các bài đăng có nhãn mongodb. Hiển thị tất cả bài đăng

15 tháng 11 2014

Mongdb 101 Part 1

Create new collection:


Update or add new element (reference link: http://docs.mongodb.org/manual/core/write-operations-introduction/)
Add 1 more item to array:
  1. Create country with array type

  2. Add new item


Delete an item in collection:

08 tháng 11 2014

PHP Driver vs Mongodb: Can not working (WAMP)

This is the first time i have installed php driver with mongodb. It make me frustrated but the problem is solved. There are 2 errors message in php_error_log i have found:

  1. 'php_mongo.dll' - The specified module could not be found.
  2. PHP Warning:  PHP Startup: mongo: Unable to initialize module.......These options need to match

The first message mean: your php driver is not correct version with mongodb. How to know the correct version? When you download a bulk of files php driver, all the file will like this:

  • php_mongo-1.5.7-5.4-vc9.dll
  • php_mongo-1.5.7-5.4-vc9-nts.dll
  • php_mongo-1.5.7-5.4-vc9-x86_64.dll
  • php_mongo-1.5.7-5.4-vc9-nts-x86_64.dll

Number "1.5.7" is the version of php driver, we don't need care about it. Next "5.4" is php version on your computer, "vc9" i guess it is build in version of php driver. The last but not least "nts" is "none theard safe", you can check your php is "thread safe" or "none thread safe" but check php[x].exe if it is "php5ts.exe" it is "thread safe" and vice versa.

So pick the correct file to install, and if you see the second message you need to try another "vc".

Good luck!!!!

19 tháng 10 2014

Hướng dẫn MongoDb

https://s3.amazonaws.com/drivers.mongodb.org/php/index.html. Download list dll mongodb driver cho PHP

Bao gồm

  1. Hướng dẫn start mongod.exe
  2. Hướng dẫn tạo file config