SlideShare une entreprise Scribd logo
1  sur  23
2010/1/30 PHP Study Tokyo  #49 Yasushi Ichikawa (id:cakephper) ‏ (id:ichikaway) MongoDB + PHP + Cake
self-introduction Yasushi Ichikawa Twitter: @cakephper Twitter: @ichikaway  Blog English http://cake.eizoku.com/blog/ Japanese http://d.hatena.ne.jp/cakephper http://d.hatena.ne.jp/ichikaway
TOPIC 1. MongoDB 2. PHP + MongoDB 3. CakePHP + MongoDB
MongoDB ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
MongoDB ,[object Object],[object Object],[object Object]
MongoDB ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
MongoDB ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
MongoDB ,[object Object],[object Object],[object Object],[object Object],Posts collection Id, title, body Id, name, tel, fax Id, name, nickname, email
MongoDB ,[object Object],[object Object],Blog Title Text tag1,tag2,tag3 Comment1 Comment2 Comment3 PC Screen RDB Blog table Title Text Tags table Tag1 Tag2 Tag3 Comment Table Comment1 Comment2 Comment3
MongoDB ,[object Object],[object Object],Blog collection Title : xxxx Text : yyyy Tag: [tag1,tag2,tag3] Comment: [comment1, comment2, comment3 ] PC Screen Mongo Blog Title Text tag1,tag2,tag3 Comment1 Comment2 Comment3
MongoDB DEMO
Pecl Mongo MongoDB + PHP
Pecl Mongo ,[object Object],[object Object],[object Object],[object Object]
Pecl Mongo ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Pecl Mongo ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Pecl Mongo DEMO
Cake Mongo MongoDB + CakePHP
Cake Mongo ,[object Object],[object Object],[object Object],[object Object],[object Object],http://github.com/ichikaway/mongoDB-Datasource
Cake Mongo DEMO
Thank you!
show dbs use hogedb show collections ichikawa={name:'ichikawa', lang:['php','perl']} db.users.save(ichikawa) yasushi={name:'yasushi', lang:['japanese','english']} db.users.save(yasushi) db.users.count() db.users.find({name:"ichikawa"}) db.users.find({lang:"english"}) db.users.update({name:"ichikawa"}, {"$push":{lang:"javascript"}}) db.users.update({name:"ichikawa"}, {"$pop":{lang:""}}) db.posts.drop() db.dropDatabase()
<?php //MongoDB find sample $mongo = new Mongo('localhost:27017'); $db = $mongo->selectDB('phpstudy'); $collection = $db->selectCollection('posts'); $cond = array('tag' => 'tag9'); $field = array(); $result = $collection->find($cond, $field); $results = null; while ($result->hasNext()) { $mongodata = $result->getNext(); if (is_object($mongodata['_id'])) { $mongodata['_id'] = $mongodata['_id']->__toString(); } $results[][$model->alias] = $mongodata; } print_r($results); $mongo->close;
<?php //mongoDB insert sample $mongo = new Mongo('localhost:27017'); $db = $mongo->selectDB('phpstudy'); $collection = $db->selectCollection('posts'); $data = array( 'title' => 'hello', 'body' => 'world', 'tag' => array('tag1', 'tag2'), ); $collection->insert($data); $mongo->close;

Contenu connexe

Tendances

Back to Basics Webinar 1: Introduction to NoSQL
Back to Basics Webinar 1: Introduction to NoSQLBack to Basics Webinar 1: Introduction to NoSQL
Back to Basics Webinar 1: Introduction to NoSQLMongoDB
 
Building Apps with MongoDB
Building Apps with MongoDBBuilding Apps with MongoDB
Building Apps with MongoDBNate Abele
 
Introduction to MongoDB
Introduction to MongoDBIntroduction to MongoDB
Introduction to MongoDBNosh Petigara
 
Webinar: Back to Basics: Thinking in Documents
Webinar: Back to Basics: Thinking in DocumentsWebinar: Back to Basics: Thinking in Documents
Webinar: Back to Basics: Thinking in DocumentsMongoDB
 
MongoDB for Beginners
MongoDB for BeginnersMongoDB for Beginners
MongoDB for BeginnersEnoch Joshua
 
Introduction to MongoDB
Introduction to MongoDBIntroduction to MongoDB
Introduction to MongoDBantoinegirbal
 
MongoDB : The Definitive Guide
MongoDB : The Definitive GuideMongoDB : The Definitive Guide
MongoDB : The Definitive GuideWildan Maulana
 
Webinaire 2 de la série « Retour aux fondamentaux » : Votre première applicat...
Webinaire 2 de la série « Retour aux fondamentaux » : Votre première applicat...Webinaire 2 de la série « Retour aux fondamentaux » : Votre première applicat...
Webinaire 2 de la série « Retour aux fondamentaux » : Votre première applicat...MongoDB
 
Back to Basics Webinar 3: Schema Design Thinking in Documents
 Back to Basics Webinar 3: Schema Design Thinking in Documents Back to Basics Webinar 3: Schema Design Thinking in Documents
Back to Basics Webinar 3: Schema Design Thinking in DocumentsMongoDB
 
Back to Basics: My First MongoDB Application
Back to Basics: My First MongoDB ApplicationBack to Basics: My First MongoDB Application
Back to Basics: My First MongoDB ApplicationMongoDB
 
Intro To Mongo Db
Intro To Mongo DbIntro To Mongo Db
Intro To Mongo Dbchriskite
 
Basics of MongoDB
Basics of MongoDB Basics of MongoDB
Basics of MongoDB Habilelabs
 
Inside MongoDB: the Internals of an Open-Source Database
Inside MongoDB: the Internals of an Open-Source DatabaseInside MongoDB: the Internals of an Open-Source Database
Inside MongoDB: the Internals of an Open-Source DatabaseMike Dirolf
 
Mongo DB: Fundamentals & Basics/ An Overview of MongoDB/ Mongo DB tutorials
Mongo DB: Fundamentals & Basics/ An Overview of MongoDB/ Mongo DB tutorialsMongo DB: Fundamentals & Basics/ An Overview of MongoDB/ Mongo DB tutorials
Mongo DB: Fundamentals & Basics/ An Overview of MongoDB/ Mongo DB tutorialsSpringPeople
 
Building Your First MongoDB App
Building Your First MongoDB AppBuilding Your First MongoDB App
Building Your First MongoDB AppHenrik Ingo
 

Tendances (20)

Indexing
IndexingIndexing
Indexing
 
Back to Basics Webinar 1: Introduction to NoSQL
Back to Basics Webinar 1: Introduction to NoSQLBack to Basics Webinar 1: Introduction to NoSQL
Back to Basics Webinar 1: Introduction to NoSQL
 
Building Apps with MongoDB
Building Apps with MongoDBBuilding Apps with MongoDB
Building Apps with MongoDB
 
Introduction to MongoDB
Introduction to MongoDBIntroduction to MongoDB
Introduction to MongoDB
 
Webinar: Back to Basics: Thinking in Documents
Webinar: Back to Basics: Thinking in DocumentsWebinar: Back to Basics: Thinking in Documents
Webinar: Back to Basics: Thinking in Documents
 
MongoDB for Beginners
MongoDB for BeginnersMongoDB for Beginners
MongoDB for Beginners
 
Python and MongoDB
Python and MongoDBPython and MongoDB
Python and MongoDB
 
Introduction to MongoDB
Introduction to MongoDBIntroduction to MongoDB
Introduction to MongoDB
 
MongoDB : The Definitive Guide
MongoDB : The Definitive GuideMongoDB : The Definitive Guide
MongoDB : The Definitive Guide
 
Mongo db basics
Mongo db basicsMongo db basics
Mongo db basics
 
Webinaire 2 de la série « Retour aux fondamentaux » : Votre première applicat...
Webinaire 2 de la série « Retour aux fondamentaux » : Votre première applicat...Webinaire 2 de la série « Retour aux fondamentaux » : Votre première applicat...
Webinaire 2 de la série « Retour aux fondamentaux » : Votre première applicat...
 
Back to Basics Webinar 3: Schema Design Thinking in Documents
 Back to Basics Webinar 3: Schema Design Thinking in Documents Back to Basics Webinar 3: Schema Design Thinking in Documents
Back to Basics Webinar 3: Schema Design Thinking in Documents
 
Python and MongoDB
Python and MongoDB Python and MongoDB
Python and MongoDB
 
Back to Basics: My First MongoDB Application
Back to Basics: My First MongoDB ApplicationBack to Basics: My First MongoDB Application
Back to Basics: My First MongoDB Application
 
Intro To Mongo Db
Intro To Mongo DbIntro To Mongo Db
Intro To Mongo Db
 
Basics of MongoDB
Basics of MongoDB Basics of MongoDB
Basics of MongoDB
 
Mongo DB Presentation
Mongo DB PresentationMongo DB Presentation
Mongo DB Presentation
 
Inside MongoDB: the Internals of an Open-Source Database
Inside MongoDB: the Internals of an Open-Source DatabaseInside MongoDB: the Internals of an Open-Source Database
Inside MongoDB: the Internals of an Open-Source Database
 
Mongo DB: Fundamentals & Basics/ An Overview of MongoDB/ Mongo DB tutorials
Mongo DB: Fundamentals & Basics/ An Overview of MongoDB/ Mongo DB tutorialsMongo DB: Fundamentals & Basics/ An Overview of MongoDB/ Mongo DB tutorials
Mongo DB: Fundamentals & Basics/ An Overview of MongoDB/ Mongo DB tutorials
 
Building Your First MongoDB App
Building Your First MongoDB AppBuilding Your First MongoDB App
Building Your First MongoDB App
 

En vedette

CakePHP2 Loading (Japanese)
CakePHP2 Loading (Japanese)CakePHP2 Loading (Japanese)
CakePHP2 Loading (Japanese)ichikaway
 
Cakephp勉強会@福岡 発表資料
Cakephp勉強会@福岡 発表資料Cakephp勉強会@福岡 発表資料
Cakephp勉強会@福岡 発表資料ichikaway
 
福岡xTwilio twilio meetup
福岡xTwilio  twilio meetup福岡xTwilio  twilio meetup
福岡xTwilio twilio meetupichikaway
 
Phpcon kansai 2011 ichikaway
Phpcon kansai 2011 ichikawayPhpcon kansai 2011 ichikaway
Phpcon kansai 2011 ichikawayichikaway
 
VAddy at LL Diver LT
VAddy at LL Diver LTVAddy at LL Diver LT
VAddy at LL Diver LTichikaway
 
FutureSync 世界の開発者とコラボしよう
FutureSync 世界の開発者とコラボしようFutureSync 世界の開発者とコラボしよう
FutureSync 世界の開発者とコラボしようichikaway
 
Experience of (Ichikaway iteigo1)
Experience of (Ichikaway iteigo1)Experience of (Ichikaway iteigo1)
Experience of (Ichikaway iteigo1)ichikaway
 
Tips of CakePHP and MongoDB - Cakefest2011 ichikaway
Tips of CakePHP and MongoDB - Cakefest2011 ichikaway Tips of CakePHP and MongoDB - Cakefest2011 ichikaway
Tips of CakePHP and MongoDB - Cakefest2011 ichikaway ichikaway
 

En vedette (8)

CakePHP2 Loading (Japanese)
CakePHP2 Loading (Japanese)CakePHP2 Loading (Japanese)
CakePHP2 Loading (Japanese)
 
Cakephp勉強会@福岡 発表資料
Cakephp勉強会@福岡 発表資料Cakephp勉強会@福岡 発表資料
Cakephp勉強会@福岡 発表資料
 
福岡xTwilio twilio meetup
福岡xTwilio  twilio meetup福岡xTwilio  twilio meetup
福岡xTwilio twilio meetup
 
Phpcon kansai 2011 ichikaway
Phpcon kansai 2011 ichikawayPhpcon kansai 2011 ichikaway
Phpcon kansai 2011 ichikaway
 
VAddy at LL Diver LT
VAddy at LL Diver LTVAddy at LL Diver LT
VAddy at LL Diver LT
 
FutureSync 世界の開発者とコラボしよう
FutureSync 世界の開発者とコラボしようFutureSync 世界の開発者とコラボしよう
FutureSync 世界の開発者とコラボしよう
 
Experience of (Ichikaway iteigo1)
Experience of (Ichikaway iteigo1)Experience of (Ichikaway iteigo1)
Experience of (Ichikaway iteigo1)
 
Tips of CakePHP and MongoDB - Cakefest2011 ichikaway
Tips of CakePHP and MongoDB - Cakefest2011 ichikaway Tips of CakePHP and MongoDB - Cakefest2011 ichikaway
Tips of CakePHP and MongoDB - Cakefest2011 ichikaway
 

Similaire à PHP MongoDB CakePHP Introduction

Rapid and Scalable Development with MongoDB, PyMongo, and Ming
Rapid and Scalable Development with MongoDB, PyMongo, and MingRapid and Scalable Development with MongoDB, PyMongo, and Ming
Rapid and Scalable Development with MongoDB, PyMongo, and MingRick Copeland
 
Introduction To Moco
Introduction To MocoIntroduction To Moco
Introduction To MocoNaoya Ito
 
Introduction to MongoDB with PHP
Introduction to MongoDB with PHPIntroduction to MongoDB with PHP
Introduction to MongoDB with PHPfwso
 
Getting started with MongoDB and PHP
Getting started with MongoDB and PHPGetting started with MongoDB and PHP
Getting started with MongoDB and PHPgates10gen
 
This upload requires better support for ODP format
This upload requires better support for ODP formatThis upload requires better support for ODP format
This upload requires better support for ODP formatForest Mars
 
How to use MongoDB with CakePHP
How to use MongoDB with CakePHPHow to use MongoDB with CakePHP
How to use MongoDB with CakePHPichikaway
 
Abstracting functionality with centralised content
Abstracting functionality with centralised contentAbstracting functionality with centralised content
Abstracting functionality with centralised contentMichael Peacock
 
DrupalCon Chicago Practical MongoDB and Drupal
DrupalCon Chicago Practical MongoDB and DrupalDrupalCon Chicago Practical MongoDB and Drupal
DrupalCon Chicago Practical MongoDB and DrupalDoug Green
 
Using MongoDB With Groovy
Using MongoDB With GroovyUsing MongoDB With Groovy
Using MongoDB With GroovyJames Williams
 
Java Development with MongoDB (James Williams)
Java Development with MongoDB (James Williams)Java Development with MongoDB (James Williams)
Java Development with MongoDB (James Williams)MongoSF
 
The FPDF Library
The FPDF LibraryThe FPDF Library
The FPDF LibraryDave Ross
 
ZendCon2010 Doctrine MongoDB ODM
ZendCon2010 Doctrine MongoDB ODMZendCon2010 Doctrine MongoDB ODM
ZendCon2010 Doctrine MongoDB ODMJonathan Wage
 
MongoDB Thinkorswim
MongoDB ThinkorswimMongoDB Thinkorswim
MongoDB ThinkorswimSethEdwards
 
Pyramid Lighter/Faster/Better web apps
Pyramid Lighter/Faster/Better web appsPyramid Lighter/Faster/Better web apps
Pyramid Lighter/Faster/Better web appsDylan Jay
 
Java Persistence Frameworks for MongoDB
Java Persistence Frameworks for MongoDBJava Persistence Frameworks for MongoDB
Java Persistence Frameworks for MongoDBMongoDB
 

Similaire à PHP MongoDB CakePHP Introduction (20)

Rapid and Scalable Development with MongoDB, PyMongo, and Ming
Rapid and Scalable Development with MongoDB, PyMongo, and MingRapid and Scalable Development with MongoDB, PyMongo, and Ming
Rapid and Scalable Development with MongoDB, PyMongo, and Ming
 
Introduction To Moco
Introduction To MocoIntroduction To Moco
Introduction To Moco
 
Introduction to MongoDB with PHP
Introduction to MongoDB with PHPIntroduction to MongoDB with PHP
Introduction to MongoDB with PHP
 
Getting started with MongoDB and PHP
Getting started with MongoDB and PHPGetting started with MongoDB and PHP
Getting started with MongoDB and PHP
 
This upload requires better support for ODP format
This upload requires better support for ODP formatThis upload requires better support for ODP format
This upload requires better support for ODP format
 
How to use MongoDB with CakePHP
How to use MongoDB with CakePHPHow to use MongoDB with CakePHP
How to use MongoDB with CakePHP
 
Abstracting functionality with centralised content
Abstracting functionality with centralised contentAbstracting functionality with centralised content
Abstracting functionality with centralised content
 
Mongo-Drupal
Mongo-DrupalMongo-Drupal
Mongo-Drupal
 
DrupalCon Chicago Practical MongoDB and Drupal
DrupalCon Chicago Practical MongoDB and DrupalDrupalCon Chicago Practical MongoDB and Drupal
DrupalCon Chicago Practical MongoDB and Drupal
 
Using MongoDB With Groovy
Using MongoDB With GroovyUsing MongoDB With Groovy
Using MongoDB With Groovy
 
Java Development with MongoDB (James Williams)
Java Development with MongoDB (James Williams)Java Development with MongoDB (James Williams)
Java Development with MongoDB (James Williams)
 
The FPDF Library
The FPDF LibraryThe FPDF Library
The FPDF Library
 
PHP 5 Sucks. PHP 5 Rocks.
PHP 5 Sucks. PHP 5 Rocks.PHP 5 Sucks. PHP 5 Rocks.
PHP 5 Sucks. PHP 5 Rocks.
 
What's New in ZF 1.10
What's New in ZF 1.10What's New in ZF 1.10
What's New in ZF 1.10
 
ZendCon2010 Doctrine MongoDB ODM
ZendCon2010 Doctrine MongoDB ODMZendCon2010 Doctrine MongoDB ODM
ZendCon2010 Doctrine MongoDB ODM
 
MongoDB Thinkorswim
MongoDB ThinkorswimMongoDB Thinkorswim
MongoDB Thinkorswim
 
The emerging world of mongo db csp
The emerging world of mongo db   cspThe emerging world of mongo db   csp
The emerging world of mongo db csp
 
Pyramid Lighter/Faster/Better web apps
Pyramid Lighter/Faster/Better web appsPyramid Lighter/Faster/Better web apps
Pyramid Lighter/Faster/Better web apps
 
Java Persistence Frameworks for MongoDB
Java Persistence Frameworks for MongoDBJava Persistence Frameworks for MongoDB
Java Persistence Frameworks for MongoDB
 
MongoDB and Node.js
MongoDB and Node.jsMongoDB and Node.js
MongoDB and Node.js
 

Plus de ichikaway

forteeに脆弱性検査をかけてみた VAddy編
forteeに脆弱性検査をかけてみた VAddy編forteeに脆弱性検査をかけてみた VAddy編
forteeに脆弱性検査をかけてみた VAddy編ichikaway
 
Understanding Computer Architecture with NES Emulator
Understanding Computer Architecture with NES EmulatorUnderstanding Computer Architecture with NES Emulator
Understanding Computer Architecture with NES Emulatorichikaway
 
VAddyの課金システムを Stripeに乗り換えた話
VAddyの課金システムを Stripeに乗り換えた話VAddyの課金システムを Stripeに乗り換えた話
VAddyの課金システムを Stripeに乗り換えた話ichikaway
 
Hello, Worldまで3ヶ月 Golangでファミコンエミュレータ実装 #gocon fukuoka 2019
Hello, Worldまで3ヶ月 Golangでファミコンエミュレータ実装 #gocon fukuoka 2019Hello, Worldまで3ヶ月 Golangでファミコンエミュレータ実装 #gocon fukuoka 2019
Hello, Worldまで3ヶ月 Golangでファミコンエミュレータ実装 #gocon fukuoka 2019ichikaway
 
ゼロから始めるファミコンエミュレータ生活 PHPerKaigi2019
ゼロから始めるファミコンエミュレータ生活 PHPerKaigi2019ゼロから始めるファミコンエミュレータ生活 PHPerKaigi2019
ゼロから始めるファミコンエミュレータ生活 PHPerKaigi2019ichikaway
 
現場で使える脆弱性検査サービス VAddy
現場で使える脆弱性検査サービス VAddy 現場で使える脆弱性検査サービス VAddy
現場で使える脆弱性検査サービス VAddy ichikaway
 
OS入門 Fukuoka.php vol.18 LT資料
OS入門 Fukuoka.php vol.18 LT資料OS入門 Fukuoka.php vol.18 LT資料
OS入門 Fukuoka.php vol.18 LT資料ichikaway
 
Yapc8oji: セキュリティテストサービスを開発運営してきた2年
Yapc8oji: セキュリティテストサービスを開発運営してきた2年Yapc8oji: セキュリティテストサービスを開発運営してきた2年
Yapc8oji: セキュリティテストサービスを開発運営してきた2年ichikaway
 
VAaddyとは VAddyミートアップvol3_20160629
VAaddyとは  VAddyミートアップvol3_20160629VAaddyとは  VAddyミートアップvol3_20160629
VAaddyとは VAddyミートアップvol3_20160629ichikaway
 
脆弱性もバグ、だからテストしよう PHPカンファンレス2015
脆弱性もバグ、だからテストしよう PHPカンファンレス2015脆弱性もバグ、だからテストしよう PHPカンファンレス2015
脆弱性もバグ、だからテストしよう PHPカンファンレス2015ichikaway
 
脆弱性もバグ、だからテストしよう DevSummiFukuoka
脆弱性もバグ、だからテストしよう DevSummiFukuoka脆弱性もバグ、だからテストしよう DevSummiFukuoka
脆弱性もバグ、だからテストしよう DevSummiFukuokaichikaway
 
Vulnerabilities are bugs, Let's test for them!
Vulnerabilities are bugs, Let's test for them!Vulnerabilities are bugs, Let's test for them!
Vulnerabilities are bugs, Let's test for them!ichikaway
 
脆弱性もバグ、だからテストしよう!
脆弱性もバグ、だからテストしよう!脆弱性もバグ、だからテストしよう!
脆弱性もバグ、だからテストしよう!ichikaway
 
継続的Webセキュリティテスト PHPカンファレンス関西2015 LT
継続的Webセキュリティテスト PHPカンファレンス関西2015 LT継続的Webセキュリティテスト PHPカンファレンス関西2015 LT
継続的Webセキュリティテスト PHPカンファレンス関西2015 LTichikaway
 
継続的Webセキュリティテスト testing casual talks2
継続的Webセキュリティテスト testing casual talks2継続的Webセキュリティテスト testing casual talks2
継続的Webセキュリティテスト testing casual talks2ichikaway
 
Ctf2015 ichikawa Eizoku PM2.5 dial
Ctf2015 ichikawa Eizoku PM2.5 dialCtf2015 ichikawa Eizoku PM2.5 dial
Ctf2015 ichikawa Eizoku PM2.5 dialichikaway
 
VAddy - CI勉強会 fukuoka
VAddy - CI勉強会 fukuokaVAddy - CI勉強会 fukuoka
VAddy - CI勉強会 fukuokaichikaway
 
Jenkinsを使った継続的セキュリティテスト
Jenkinsを使った継続的セキュリティテストJenkinsを使った継続的セキュリティテスト
Jenkinsを使った継続的セキュリティテストichikaway
 
継続的セキュリティテストVaddy説明資料
継続的セキュリティテストVaddy説明資料継続的セキュリティテストVaddy説明資料
継続的セキュリティテストVaddy説明資料ichikaway
 
phpcon kansai 20140628
phpcon kansai 20140628phpcon kansai 20140628
phpcon kansai 20140628ichikaway
 

Plus de ichikaway (20)

forteeに脆弱性検査をかけてみた VAddy編
forteeに脆弱性検査をかけてみた VAddy編forteeに脆弱性検査をかけてみた VAddy編
forteeに脆弱性検査をかけてみた VAddy編
 
Understanding Computer Architecture with NES Emulator
Understanding Computer Architecture with NES EmulatorUnderstanding Computer Architecture with NES Emulator
Understanding Computer Architecture with NES Emulator
 
VAddyの課金システムを Stripeに乗り換えた話
VAddyの課金システムを Stripeに乗り換えた話VAddyの課金システムを Stripeに乗り換えた話
VAddyの課金システムを Stripeに乗り換えた話
 
Hello, Worldまで3ヶ月 Golangでファミコンエミュレータ実装 #gocon fukuoka 2019
Hello, Worldまで3ヶ月 Golangでファミコンエミュレータ実装 #gocon fukuoka 2019Hello, Worldまで3ヶ月 Golangでファミコンエミュレータ実装 #gocon fukuoka 2019
Hello, Worldまで3ヶ月 Golangでファミコンエミュレータ実装 #gocon fukuoka 2019
 
ゼロから始めるファミコンエミュレータ生活 PHPerKaigi2019
ゼロから始めるファミコンエミュレータ生活 PHPerKaigi2019ゼロから始めるファミコンエミュレータ生活 PHPerKaigi2019
ゼロから始めるファミコンエミュレータ生活 PHPerKaigi2019
 
現場で使える脆弱性検査サービス VAddy
現場で使える脆弱性検査サービス VAddy 現場で使える脆弱性検査サービス VAddy
現場で使える脆弱性検査サービス VAddy
 
OS入門 Fukuoka.php vol.18 LT資料
OS入門 Fukuoka.php vol.18 LT資料OS入門 Fukuoka.php vol.18 LT資料
OS入門 Fukuoka.php vol.18 LT資料
 
Yapc8oji: セキュリティテストサービスを開発運営してきた2年
Yapc8oji: セキュリティテストサービスを開発運営してきた2年Yapc8oji: セキュリティテストサービスを開発運営してきた2年
Yapc8oji: セキュリティテストサービスを開発運営してきた2年
 
VAaddyとは VAddyミートアップvol3_20160629
VAaddyとは  VAddyミートアップvol3_20160629VAaddyとは  VAddyミートアップvol3_20160629
VAaddyとは VAddyミートアップvol3_20160629
 
脆弱性もバグ、だからテストしよう PHPカンファンレス2015
脆弱性もバグ、だからテストしよう PHPカンファンレス2015脆弱性もバグ、だからテストしよう PHPカンファンレス2015
脆弱性もバグ、だからテストしよう PHPカンファンレス2015
 
脆弱性もバグ、だからテストしよう DevSummiFukuoka
脆弱性もバグ、だからテストしよう DevSummiFukuoka脆弱性もバグ、だからテストしよう DevSummiFukuoka
脆弱性もバグ、だからテストしよう DevSummiFukuoka
 
Vulnerabilities are bugs, Let's test for them!
Vulnerabilities are bugs, Let's test for them!Vulnerabilities are bugs, Let's test for them!
Vulnerabilities are bugs, Let's test for them!
 
脆弱性もバグ、だからテストしよう!
脆弱性もバグ、だからテストしよう!脆弱性もバグ、だからテストしよう!
脆弱性もバグ、だからテストしよう!
 
継続的Webセキュリティテスト PHPカンファレンス関西2015 LT
継続的Webセキュリティテスト PHPカンファレンス関西2015 LT継続的Webセキュリティテスト PHPカンファレンス関西2015 LT
継続的Webセキュリティテスト PHPカンファレンス関西2015 LT
 
継続的Webセキュリティテスト testing casual talks2
継続的Webセキュリティテスト testing casual talks2継続的Webセキュリティテスト testing casual talks2
継続的Webセキュリティテスト testing casual talks2
 
Ctf2015 ichikawa Eizoku PM2.5 dial
Ctf2015 ichikawa Eizoku PM2.5 dialCtf2015 ichikawa Eizoku PM2.5 dial
Ctf2015 ichikawa Eizoku PM2.5 dial
 
VAddy - CI勉強会 fukuoka
VAddy - CI勉強会 fukuokaVAddy - CI勉強会 fukuoka
VAddy - CI勉強会 fukuoka
 
Jenkinsを使った継続的セキュリティテスト
Jenkinsを使った継続的セキュリティテストJenkinsを使った継続的セキュリティテスト
Jenkinsを使った継続的セキュリティテスト
 
継続的セキュリティテストVaddy説明資料
継続的セキュリティテストVaddy説明資料継続的セキュリティテストVaddy説明資料
継続的セキュリティテストVaddy説明資料
 
phpcon kansai 20140628
phpcon kansai 20140628phpcon kansai 20140628
phpcon kansai 20140628
 

Dernier

"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
Vector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesVector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesZilliz
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clashcharlottematthew16
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostZilliz
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Wonjun Hwang
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024The Digital Insurer
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 

Dernier (20)

"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
Vector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesVector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector Databases
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clash
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 

PHP MongoDB CakePHP Introduction

  • 1. 2010/1/30 PHP Study Tokyo #49 Yasushi Ichikawa (id:cakephper) ‏ (id:ichikaway) MongoDB + PHP + Cake
  • 2. self-introduction Yasushi Ichikawa Twitter: @cakephper Twitter: @ichikaway Blog English http://cake.eizoku.com/blog/ Japanese http://d.hatena.ne.jp/cakephper http://d.hatena.ne.jp/ichikaway
  • 3. TOPIC 1. MongoDB 2. PHP + MongoDB 3. CakePHP + MongoDB
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.
  • 9.
  • 10.
  • 13.
  • 14.
  • 15.
  • 17. Cake Mongo MongoDB + CakePHP
  • 18.
  • 21. show dbs use hogedb show collections ichikawa={name:'ichikawa', lang:['php','perl']} db.users.save(ichikawa) yasushi={name:'yasushi', lang:['japanese','english']} db.users.save(yasushi) db.users.count() db.users.find({name:&quot;ichikawa&quot;}) db.users.find({lang:&quot;english&quot;}) db.users.update({name:&quot;ichikawa&quot;}, {&quot;$push&quot;:{lang:&quot;javascript&quot;}}) db.users.update({name:&quot;ichikawa&quot;}, {&quot;$pop&quot;:{lang:&quot;&quot;}}) db.posts.drop() db.dropDatabase()
  • 22. <?php //MongoDB find sample $mongo = new Mongo('localhost:27017'); $db = $mongo->selectDB('phpstudy'); $collection = $db->selectCollection('posts'); $cond = array('tag' => 'tag9'); $field = array(); $result = $collection->find($cond, $field); $results = null; while ($result->hasNext()) { $mongodata = $result->getNext(); if (is_object($mongodata['_id'])) { $mongodata['_id'] = $mongodata['_id']->__toString(); } $results[][$model->alias] = $mongodata; } print_r($results); $mongo->close;
  • 23. <?php //mongoDB insert sample $mongo = new Mongo('localhost:27017'); $db = $mongo->selectDB('phpstudy'); $collection = $db->selectCollection('posts'); $data = array( 'title' => 'hello', 'body' => 'world', 'tag' => array('tag1', 'tag2'), ); $collection->insert($data); $mongo->close;