MongoDBѧϰ±Ê¼Ç(Ò») MongoDB½éÉܼ°°²×°
Ò»¡¢Ç°ÑÔ
¡¡¡¡×î½ü¿ªÊ¼Ñ§Ï°·Ç¹ØϵÐÍÊý¾Ý¿âMongoDB£¬È´ÔÚ²©¿ÍÔ°ÉÏÕÒ²»µ½±È½ÏϵͳµÄ½Ì³Ì£¬ºÜ¶à×ÊÁ϶¼ÒªÈ¥²éÔÄÓ¢ÎÄÍøÕ¾£¬Ð§ÂʱȽϵÍÏ¡£±¾È˲»²Å£¬½è×Å×Ô Ñ§µÄ»ú»á°ÑÐĵÃÌå»á¶¼¼Ç¼ÏÂÀ´£¬·½±ã¸ÐÐËȤµÄͯЬ·ÖÏíÌÖÂÛ¡£²¿·Ö×ÊÔ´³ö×ÔÆäËû²©¿Í£¬Ö¼½«Áãɢ֪ʶµã¼¯Öе½Ò»Æð£¬Èç¹ûÓÐÇÖ·¸ÄúµÄȨÀû£¬ÇëÁªÏµli- pan2@163.com¡£´ó²¿·ÖÄÚÈݾùϵԴ´£¬»¶Ó´ó¼ÒתÔØ·ÖÏí£¬µ«×ªÔصÄͬʱ±ðÍüÁË×¢Ã÷×÷ÕߺÍÔÎÄÁ´½ÓŶ¡£
¶þ¡¢MongoDB¼ò½é
¡¡¡¡MongoDBÊÇÒ»¸ö¸ßÐÔÄÜ£¬¿ªÔ´£¬ÎÞģʽµÄÎĵµÐÍÊý¾Ý¿â£¬Êǵ±Ç°NoSqlÊý¾Ý¿âÖбȽÏÈÈÃŵÄÒ»ÖÖ¡£ËüÔÚÐí¶à³¡¾°Ï¿ÉÓÃÓÚÌæ´ú´«Í³µÄ¹ØϵÐÍÊý¾Ý¿â»ò¼ü/Öµ´æ´¢·½Ê½¡£MongoʹÓÃC++¿ª·¢¡£MongoµÄ¹Ù·½ÍøÕ¾µØÖ·ÊÇ£ºhttp://www.mongodb.org/£¬¶ÁÕß¿ÉÒÔÔÚ´Ë»ñµÃ¸üÏêϸµÄÐÅÏ¢¡£
С²åÇú£ºÊ²Ã´ÊÇNoSql£¿
¡¡¡¡NoSql£¬È«³ÆÊÇ Not Only Sql,Ö¸µÄÊǷǹØϵÐ͵ÄÊý¾Ý¿â¡£ÏÂÒ»´úÊý¾Ý¿âÖ÷Òª½â¾ö¼¸¸öÒªµã£º·Ç¹ØϵÐ͵ġ¢·Ö²¼Ê½µÄ¡¢¿ªÔ´µÄ¡¢Ë®Æ½¿ÉÀ©Õ¹µÄ¡£ÔʼµÄÄ¿µÄÊÇΪÁË´ó¹æÄ£webÓ¦Óã¬Õⳡ Ô˶¯¿ªÊ¼ÓÚ2009Äê³õ£¬Í¨³£ÌØÐÔÓ¦ÓÃÈ磺ģʽ×ÔÓÉ¡¢Ö§³Ö¼òÒ׸´ÖÆ¡¢¼òµ¥µÄAPI¡¢×îÖÕµÄÒ»ÖÂÐÔ£¨·ÇACID£©¡¢´óÈÝÁ¿Êý¾ÝµÈ¡£NoSQL±»ÎÒÃÇÓõÃ×î¶à µÄµ±Êýkey-value´æ´¢£¬µ±È»»¹ÓÐÆäËûµÄÎĵµÐ͵ġ¢Áд洢¡¢Í¼ÐÍÊý¾Ý¿â¡¢xmlÊý¾Ý¿âµÈ¡£
¡¡¡¡Ìصã:
¡¡¡¡¸ßÐÔÄÜ¡¢Òײ¿Êð¡¢Ò×ʹÓ㬴洢Êý¾Ý·Ç³£·½±ã¡£Ö÷Òª¹¦ÄÜÌØÐÔÓУº
- ÃæÏò¼¯ºÏ´æ´¢£¬Ò×´æ´¢¶ÔÏóÀàÐ͵ÄÊý¾Ý¡£
- ģʽ×ÔÓÉ¡£
- Ö§³Ö¶¯Ì¬²éѯ¡£
- Ö§³ÖÍêÈ«Ë÷Òý£¬°üº¬ÄÚ²¿¶ÔÏó¡£
- Ö§³Ö²éѯ¡£
- Ö§³Ö¸´Öƺ͹ÊÕϻָ´¡£
- ʹÓøßЧµÄ¶þ½øÖÆÊý¾Ý´æ´¢£¬°üÀ¨´óÐͶÔÏó£¨ÈçÊÓƵµÈ£©¡£
- ×Ô¶¯´¦ÀíËéƬ£¬ÒÔÖ§³ÖÔƼÆËã²ã´ÎµÄÀ©Õ¹ÐÔ
- Ö§³ÖPython£¬PHP£¬Ruby£¬Java£¬C£¬C#£¬Javascript£¬Perl¼°C++ÓïÑÔµÄÇý¶¯³ÌÐò£¬ÉçÇøÖÐÒ²ÌṩÁ˶ÔErlang¼°.NETµÈƽ̨µÄÇý¶¯³ÌÐò¡£
- Îļþ´æ´¢¸ñʽΪBSON£¨Ò»ÖÖJSONµÄÀ©Õ¹£©¡£
- ¿Éͨ¹ýÍøÂç·ÃÎÊ¡£
¡¡¡¡¹¦ÄÜ:
- ÃæÏò¼¯ºÏµÄ´æ´¢£ºÊʺϴ洢¶ÔÏó¼°JSONÐÎʽµÄÊý¾Ý¡£
- ¶¯Ì¬²éѯ£ºMongoÖ§³Ö·á¸»µÄ²éѯ±í´ïʽ¡£²éѯָÁîʹÓÃJSONÐÎʽµÄ±ê¼Ç£¬¿ÉÇáÒײéѯÎĵµÖÐÄÚǶµÄ¶ÔÏó¼°Êý×é¡£
- ÍêÕûµÄË÷ÒýÖ§³Ö£º°üÀ¨ÎĵµÄÚǶ¶ÔÏó¼°Êý×é¡£MongoµÄ²éѯÓÅ»¯Æ÷»á·ÖÎö²éѯ±í´ïʽ£¬²¢Éú³ÉÒ»¸ö¸ßЧµÄ²éѯ¼Æ»®¡£
- ²éѯ¼àÊÓ£ºMongo°üº¬Ò»¸ö¼àÊÓ¹¤¾ßÓÃÓÚ·ÖÎöÊý¾Ý¿â²Ù×÷µÄÐÔÄÜ¡£
- ¸´ÖƼ°×Ô¶¯¹ÊÕÏתÒÆ£ºMongoÊý¾Ý¿âÖ§³Ö·þÎñÆ÷Ö®¼äµÄÊý¾Ý¸´ÖÆ£¬Ö§³ÖÖ÷-´Óģʽ¼°·þÎñÆ÷Ö®¼äµÄÏ໥¸´ÖÆ¡£¸´ÖƵÄÖ÷ҪĿ±êÊÇÌṩÈßÓ༰×Ô¶¯¹ÊÕÏתÒÆ¡£
- ¸ßЧµÄ´«Í³´æ´¢·½Ê½£ºÖ§³Ö¶þ½øÖÆÊý¾Ý¼°´óÐͶÔÏó£¨ÈçÕÕƬ»òͼƬ£©
- ×Ô¶¯·ÖƬÒÔÖ§³ÖÔƼ¶±ðµÄÉìËõÐÔ£º×Ô¶¯·ÖƬ¹¦ÄÜÖ§³ÖˮƽµÄÊý¾Ý¿â¼¯Èº£¬¿É¶¯Ì¬Ìí¼Ó¶îÍâµÄ»úÆ÷¡£
¡¡¡¡ÊÊÓó¡ºÏ:
- ÍøÕ¾Êý¾Ý£ºMongo·Ç³£ÊʺÏʵʱµÄ²åÈ룬¸üÐÂÓë²éѯ£¬²¢¾ß±¸ÍøվʵʱÊý¾Ý´æ´¢ËùÐèµÄ¸´ÖƼ°¸ß¶ÈÉìËõÐÔ¡£
- »º´æ£ºÓÉÓÚÐÔÄܸܺߣ¬MongoÒ²ÊʺÏ×÷ΪÐÅÏ¢»ù´¡ÉèÊ©µÄ»º´æ²ã¡£ÔÚϵͳÖØÆôÖ®ºó£¬ÓÉMongo´î½¨µÄ³Ö¾Ã»¯»º´æ²ã¿ÉÒÔ±ÜÃâϲãµÄÊý¾ÝÔ´ ¹ýÔØ¡£
- ´ó³ß´ç£¬µÍ¼ÛÖµµÄÊý¾Ý£ºÊ¹Óô«Í³µÄ¹ØϵÐÍÊý¾Ý¿â´æ´¢Ò»Ð©Êý¾Ýʱ¿ÉÄÜ»á±È½Ï°º¹ó£¬ÔÚ´Ë֮ǰ£¬ºÜ¶àʱºò³ÌÐòÔ±ÍùÍù»áÑ¡Ôñ´«Í³µÄÎļþ½øÐд洢¡£
- ¸ßÉìËõÐԵij¡¾°£ºMongo·Ç³£ÊʺÏÓÉÊýÊ®»òÊý°Ų̀·þÎñÆ÷×é³ÉµÄÊý¾Ý¿â¡£MongoµÄ·ÏßͼÖÐÒѾ°üº¬¶ÔMapReduceÒýÇæµÄÄÚÖÃÖ§³Ö¡£
- ÓÃÓÚ¶ÔÏó¼°JSONÊý¾ÝµÄ´æ´¢£ºMongoµÄBSONÊý¾Ý¸ñʽ·Ç³£ÊʺÏÎĵµ»¯¸ñʽµÄ´æ´¢¼°²éѯ¡£
Èý¡¢ÏÂÔØ°²×°ºÍÅäÖÃ
¡¡¡¡°²×°MongoÊý¾Ý¿â£º
¡¡¡¡ÔÚ·¢²¼±¾ÎĵÄʱ¼ä¹Ù·½ÌṩµÄ×îа汾ÊÇ£º1.6.5 £¬Èç¹û²»×öÌØÊâÉùÃ÷£¬±¾½Ì³ÌËùÓõİ汾½«»áÊÇÕâ¸ö°æ±¾¡£
- µÚÒ»²½£ºÏÂÔØ°²×°°ü£º¹Ù·½ÏÂÔصØÖ·¡ûµ¥»÷´Ë´¦,Èç¹ûÊÇwinϵͳ£¬×¢ÒâÊÇ64λ»¹ÊÇ32λ°æ±¾µÄ£¬ÇëÑ¡ÔñÕýÈ·µÄ°æ±¾¡£
- µÚ¶þ²½£ºÐ½¨Ä¿Â¼¡°D:\MongoDB¡±£¬½âѹÏÂÔص½µÄ°²×°°ü£¬ÕÒµ½binĿ¼ÏÂÃæÈ«²¿.exeÎļþ£¬¿½±´µ½¸Õ´´½¨µÄĿ¼Ï¡£
- µÚÈý²½£ºÔÚ¡°D:\MongoDB¡±Ä¿Â¼ÏÂн¨¡°data¡±Îļþ¼Ð£¬Ëü½«»á×÷ΪÊý¾Ý´æ·ÅµÄ¸ùÎļþ¼Ð¡£
¡¡¡¡ÅäÖÃMongo·þÎñ¶Ë£º
¡¡¡¡´ò¿ªCMD´°¿Ú£¬°´ÕÕÈçÏ·½Ê½ÊäÈëÃüÁ
¡¡¡¡> d:
¡¡¡¡> cd D:\MongoDB
¡¡¡¡> mongod --dbpath D:\MongoDB\data
¡¡¡¡ÅäÖóɹ¦ºó»á¿´µ½ÈçÏ»Ã棺
¡¡¡¡ÔÚä¯ÀÀÆ÷ÊäÈ룺http://localhost:27017/£¬¿ÉÒÔ¿´µ½ÈçÏÂÌáʾ£º
You are trying to access MongoDB on the native driver port. For http diagnostic access, add 1000 to the port number
¡¡¡¡Èç´Ë£¬MongoDBÊý¾Ý¿â·þÎñÒѾ³É¹¦Æô¶¯ÁË¡£
ËÄ¡¢ºó¼Ç
¡¡¡¡ÏÖÔÚÎÒÃÇÒѾ³õ²½ÊµÏÖÁËMongoDBµÄ°²×°ºÍ·þÎñµÄÆô¶¯¹¤×÷¡£ºóÃæÎÒÃÇ»¹ÓкܶàµÄ¹¤×÷£¬ÒªÊ¹MongoDBÄÜÔÚÎÒÃǵÄC#´úÂëÖб»²Ù×÷£¬»¹ÐèÒªÇý¶¯£¬¾³£ÓÐÅóÓÑÔÚÍøÉÏcopy´úÂëºó·¢ÏÖ±àÒ벻ͨ¹ý£¬ÄǹÀ¼ÆÊÇÇý¶¯²»Ò»ÖµÄÎÊÌâÁË£¬ÏÂƪÎÄÕ»áÏêϸ½²½â£¬Î´Íê´ýÐø¡£¡£
ÍƼöÐÅÏ¢
- ¡¾ÊÓƵ²¥·Å¡¿JplayerÊÓƵ²¥·ÅÆ÷µÄʹÓÃ
- memcacheÄÚ´æÔÀí
- Memcache¼¼Êõ·ÖÏí£º½éÉÜ¡¢Ê¹Óᢴ洢¡¢Ëã·¨¡¢ÓÅ»¯....
- php³£ÓÃÕýÔò±í´ïʽ
- phpÐÔÄܼà²âÄ£¿éXHProf
- ÈÃCI¿ò¼ÜÖ§³Öservice²ã
- ʹÓÃPHPÉú³É´øLOGOµÄ¸öÐÔ»¯¶þάÂëͼÏñ
- ¹ØÓÚCodeIgniterÄã¿ÉÄܲ»ÖªµÀµÄ5¸ö֪ʶµã
- Memcache ºÁÃ뼶³¬Ê±¼°ÆäËû³£¼ûÎÊÌâ»ã×Ü
- [PHP±Ê¼Ç]PHPQueryÒ»¸ö´¦ÀíDOMµÄÀûÆ÷
ÈÈÃÅÐÅÏ¢
- nohup: redirecting stderr to stdou....
- ʹÓÃlog_formatΪNginx·þÎñÆ÷ÉèÖøüÏêϸµÄÈÕÖ¾¸ñʽ
- jquery easyUI--dataGrid-Json
- [Ô´´]·ÂGoogle Reader¡¢ÐÂÀË΢²©¡¢ÌÚѶ΢²©µ....
- ÀûÓÃKeepalived+mysql¹¹½¨¸ß¿ÉÓÃMySQLË«Ö÷×Ô¶....
- Nginx+keepalivedʵÏÖ¸ºÔؾùºâºÍË«»úÈȱ¸¸ß¿ÉÓÃ
- jqueryʵÏÖÒ³Ãæ¼ÓÔؽø¶ÈÌõ
- Rolling cURL: PHP²¢·¢×î¼Ñʵ¼ù
- codeigniter ·ÓÉÖÕ¼«ÓÅ»¯(url rewrite)
- linuxÏÂÉèÖÃsshÎÞÃÜÂëµÇ¼
×î½ü¸üÐÂ
- PHP»ñÈ¡Óû§µÄÕæʵIP£¬²¢ÅжÏÊÇ·ñÄÚÍøIP
- PHP ´íÎóÈÕÖ¾ error_log
- ÀûÓÃbigpipe»úÖÆʵÏÖÒ³ÃæÄ£¿éµÄÒì²½äÖȾ chunked¼¼Êõ
- php¿ØÖÆÎļþÏÂÔØËÙ¶È
- js + php ¶ÁÈ¡¡¢²¥·ÅÊÓƵÁ÷ ¼æÈÝfirefox£¬c....
- ¡¾ÊÓƵ²¥·Å¡¿JplayerÊÓƵ²¥·ÅÆ÷µÄʹÓÃ
- UNICODE Óë UTF-8 µÄ¹Øϵ
- memcacheÄÚ´æÔÀí
- Memcache¼¼Êõ·ÖÏí£º½éÉÜ¡¢Ê¹Óᢴ洢¡¢Ëã·¨¡¢ÓÅ»¯....
- phpʹÓÃmb_detect_encoding¼ì²â×Ö·û´®±àÂë
ÆÀÂÛ