SlideShare a Scribd company logo
1 of 25
Download to read offline
Mongo Tokyo 2011 - node.js + MongoDB
Mongo Tokyo 2011 - node.js + MongoDB
Mongo Tokyo 2011 - node.js + MongoDB
Mongo Tokyo 2011 - node.js + MongoDB
Mongo Tokyo 2011 - node.js + MongoDB
Mongo Tokyo 2011 - node.js + MongoDB
Mongo Tokyo 2011 - node.js + MongoDB
Mongo Tokyo 2011 - node.js + MongoDB




                                         HTTP
                                       WebSocket




     Client (Flash)                       LB

                                                    node.js
                                                                             3x3 Sharding
                                                                              MongoDB



                                                               Content
                                                   SVN or git Distribution
Mongo Tokyo 2011 - node.js + MongoDB
Mongo Tokyo 2011 - node.js + MongoDB



                        var entity = {
                          _id: ‘abc’,
                          name: ‘test’,
                          body: {
                            parts: {
                              face: 0, eye: 2, nose: 4, mouth: 2
                            },
                            colors: {
                               skin: 1, eye: 4, hair: 3
                            }
                          }
                        };

                        col.save(entity);

                        col.findOne({_id:‘abc’}, function(err, result) {
                            console.log(result.body.parts);
                        });

                        col.update({_id:‘abc’},
                          {‘$set’, {name: ‘modified’}}
                        );
Mongo Tokyo 2011 - node.js + MongoDB




                        https://github.com/orlandov/node-mongodb/




                        https://github.com/christkv/node-mongodb-native/
Mongo Tokyo 2011 - node.js + MongoDB
Mongo Tokyo 2011 - node.js + MongoDB




                var client = new Db('test', new Server("127.0.0.1", 27017, {}));
                client.open(function(err, p_client) {
                  client.createCollection('test_insert',function(err, collection) {
                    client.collection('test_insert', function(err, collection) {
                      for(var i = 1; i < 1000; i++) {
                        collection.insert({c:1}, function(err, docs) {});
                      }
                      collection.insert({a:2}, function(err, docs) {
                        collection.insert({a:3}, function(err, docs) {
                          collection.count(function(err, count) {
                            test.assertEquals(1001, count);
                            collection.find(function(err, cursor) {
                              cursor.toArray(function(err, results) {
                                test.assertEquals(1001, results.length);
                                test.assertTrue(results[0] != null);
                                client.close();
                              });
                            });
                          });
                        });
                      });
                    });
                  });
                });
Mongo Tokyo 2011 - node.js + MongoDB
Mongo Tokyo 2011 - node.js + MongoDB




                var db = new Database(‘127.0.0.1’, 3306, ‘test’);
                db.open();

                var item = db.collection(‘item’);

                item
                  .begin()
                  .insert({_id:‘test’, name:‘abcdefg’})
                  .insert({_id:‘test2’, name:‘123456’, values:[0,1,2,3]);
                  .update({_id:‘test’}, {‘$set’: { name: ‘hijklmn’ })
                  .find({}).each(function(entity) {
                     console.log(entity.name);
                  })
                  .success(function() {
                     console.log(‘done’);
                  })
                  .failure(function(err) {
                     console.log(‘error’, err);
                  })
                  .end();
Mongo Tokyo 2011 - node.js + MongoDB




                        https://github.com/LearnBoost/mongoose
Mongo Tokyo 2011 - node.js + MongoDB
Mongo Tokyo 2011 - node.js + MongoDB
Mongo Tokyo 2011 - node.js + MongoDB
Mongo Tokyo 2011 - node.js + MongoDB




                var spec1 = {
                   name: ‘test’,
                   type: ‘text’,
                   label: ‘label-1’,
                   class: ‘number’,
                   min: 0, max: 100
                };

                var spec2 = {
                   name: ‘test2’,
                   type: ‘group’,
                   label: ‘group-1’,
                   fields: [spec3, spec4, spec5]
                };

                var formSpec = [
                   spec1, spec2
                ];

                showForm(formSpec);
Mongo Tokyo 2011 - node.js + MongoDB
Mongo Tokyo 2011 - node.js + MongoDB
Mongo Tokyo 2011 - node.js + MongoDB

                                 { "_id" : "plant_ichigo",

                                       "name" : "    ",
                                       "type" : "plant",
                                       "plant" : {
                                         "tags" : [ "vegetable" ],
                                         "time" : { "grow" : 10, "expire" : 60 },
                                         "rewards" : [
                                 !       {
                                 !       !    "type" : "coin",
                                 !       !    "rate" : 1,
                                 !       !    "min" : 5,
                                 !       !    "max" : 20,
                                 !       !    "code" : ""
                                 !       },
                                 !       {
                                 !       !    "type" : "exp",
                                 !       !    "rate" : 1,
                                 !       !    "min" : 1,
                                 !       !    "max" : 2,
                                 !       !    "code" : ""
                                 !       },
                                 !       {
                                 !       !    "type" : "item",
                                 !       !    "rate" : 1,
                                 !       !    "min" : 1,
                                 !       !    "max" : 1,
                                 !       !    "code" : "material_ichigo"
                                 !       }
                                 ]}
Mongo Tokyo 2011 - node.js + MongoDB

More Related Content

What's hot

Building your first Node app with Connect & Express
Building your first Node app with Connect & ExpressBuilding your first Node app with Connect & Express
Building your first Node app with Connect & ExpressChristian Joudrey
 
Supercharging reflective libraries with InvokeDynamic
Supercharging reflective libraries with InvokeDynamicSupercharging reflective libraries with InvokeDynamic
Supercharging reflective libraries with InvokeDynamicIan Robertson
 
Metaprogramming with JavaScript
Metaprogramming with JavaScriptMetaprogramming with JavaScript
Metaprogramming with JavaScriptTimur Shemsedinov
 
Building a real life application in node js
Building a real life application in node jsBuilding a real life application in node js
Building a real life application in node jsfakedarren
 
Getting started with developing Nodejs
Getting started with developing NodejsGetting started with developing Nodejs
Getting started with developing NodejsPhil Hawksworth
 
はじめてのMongoDB
はじめてのMongoDBはじめてのMongoDB
はじめてのMongoDBTakahiro Inoue
 
FrozenRails Training
FrozenRails TrainingFrozenRails Training
FrozenRails TrainingMike Dirolf
 
20110514 mongo dbチューニング
20110514 mongo dbチューニング20110514 mongo dbチューニング
20110514 mongo dbチューニングYuichi Matsuo
 
Social Analytics with MongoDB
Social Analytics with MongoDBSocial Analytics with MongoDB
Social Analytics with MongoDBPatrick Stokes
 
MongoDB - Monitoring & queueing
MongoDB - Monitoring & queueingMongoDB - Monitoring & queueing
MongoDB - Monitoring & queueingBoxed Ice
 
Understanding the Node.js Platform
Understanding the Node.js PlatformUnderstanding the Node.js Platform
Understanding the Node.js PlatformDomenic Denicola
 
高性能かつスケールアウト可能なHPCクラウド AIST Super Green Cloud
高性能かつスケールアウト可能なHPCクラウド AIST Super Green Cloud高性能かつスケールアウト可能なHPCクラウド AIST Super Green Cloud
高性能かつスケールアウト可能なHPCクラウド AIST Super Green CloudRyousei Takano
 
How to build microservices with node.js
How to build microservices with node.jsHow to build microservices with node.js
How to build microservices with node.jsKaty Slemon
 

What's hot (20)

Node.js Stream API
Node.js Stream APINode.js Stream API
Node.js Stream API
 
Building your first Node app with Connect & Express
Building your first Node app with Connect & ExpressBuilding your first Node app with Connect & Express
Building your first Node app with Connect & Express
 
Introduction to Node.js
Introduction to Node.jsIntroduction to Node.js
Introduction to Node.js
 
Supercharging reflective libraries with InvokeDynamic
Supercharging reflective libraries with InvokeDynamicSupercharging reflective libraries with InvokeDynamic
Supercharging reflective libraries with InvokeDynamic
 
Couchdb w Ruby'm
Couchdb w Ruby'mCouchdb w Ruby'm
Couchdb w Ruby'm
 
Metaprogramming with JavaScript
Metaprogramming with JavaScriptMetaprogramming with JavaScript
Metaprogramming with JavaScript
 
Building a real life application in node js
Building a real life application in node jsBuilding a real life application in node js
Building a real life application in node js
 
Getting started with developing Nodejs
Getting started with developing NodejsGetting started with developing Nodejs
Getting started with developing Nodejs
 
Trimming The Cruft
Trimming The CruftTrimming The Cruft
Trimming The Cruft
 
はじめてのMongoDB
はじめてのMongoDBはじめてのMongoDB
はじめてのMongoDB
 
2011 09-pdfjs
2011 09-pdfjs2011 09-pdfjs
2011 09-pdfjs
 
FrozenRails Training
FrozenRails TrainingFrozenRails Training
FrozenRails Training
 
20110514 mongo dbチューニング
20110514 mongo dbチューニング20110514 mongo dbチューニング
20110514 mongo dbチューニング
 
Interactive subway map
Interactive subway mapInteractive subway map
Interactive subway map
 
Social Analytics with MongoDB
Social Analytics with MongoDBSocial Analytics with MongoDB
Social Analytics with MongoDB
 
MongoDB - Monitoring & queueing
MongoDB - Monitoring & queueingMongoDB - Monitoring & queueing
MongoDB - Monitoring & queueing
 
Understanding the Node.js Platform
Understanding the Node.js PlatformUnderstanding the Node.js Platform
Understanding the Node.js Platform
 
Performance patterns
Performance patternsPerformance patterns
Performance patterns
 
高性能かつスケールアウト可能なHPCクラウド AIST Super Green Cloud
高性能かつスケールアウト可能なHPCクラウド AIST Super Green Cloud高性能かつスケールアウト可能なHPCクラウド AIST Super Green Cloud
高性能かつスケールアウト可能なHPCクラウド AIST Super Green Cloud
 
How to build microservices with node.js
How to build microservices with node.jsHow to build microservices with node.js
How to build microservices with node.js
 

Viewers also liked

[大図解]ピグライフはこう動いている
[大図解]ピグライフはこう動いている[大図解]ピグライフはこう動いている
[大図解]ピグライフはこう動いているAkihiro Kuwano
 
Node.js を選ぶとき 選ばないとき
Node.js を選ぶとき 選ばないときNode.js を選ぶとき 選ばないとき
Node.js を選ぶとき 選ばないときRyunosuke SATO
 
Node.js×mongo dbで3年間サービス運用してみた話
Node.js×mongo dbで3年間サービス運用してみた話Node.js×mongo dbで3年間サービス運用してみた話
Node.js×mongo dbで3年間サービス運用してみた話leverages_event
 
Node.js基礎の基礎 - Miyazaki.js vol.2
Node.js基礎の基礎 - Miyazaki.js vol.2Node.js基礎の基礎 - Miyazaki.js vol.2
Node.js基礎の基礎 - Miyazaki.js vol.2Nobuhiro Nakashima
 
しごとで使うTitanium 第2版
しごとで使うTitanium 第2版しごとで使うTitanium 第2版
しごとで使うTitanium 第2版忠利 花崎
 
イベント駆動プログラミングとI/O多重化
イベント駆動プログラミングとI/O多重化イベント駆動プログラミングとI/O多重化
イベント駆動プログラミングとI/O多重化Gosuke Miyashita
 
Shinjuku.rb 20151125 PayPal 101
Shinjuku.rb 20151125 PayPal 101Shinjuku.rb 20151125 PayPal 101
Shinjuku.rb 20151125 PayPal 101Junichi Okamura
 
コンポーネント単位で考えるWeb制作
コンポーネント単位で考えるWeb制作コンポーネント単位で考えるWeb制作
コンポーネント単位で考えるWeb制作祐磨 堀
 
パーフェクト"Elixir情報収集"
パーフェクト"Elixir情報収集"パーフェクト"Elixir情報収集"
パーフェクト"Elixir情報収集"Keisuke Takahashi
 
API Meetup #8 PayPal API
API Meetup #8 PayPal APIAPI Meetup #8 PayPal API
API Meetup #8 PayPal APIJunichi Okamura
 
Node.js Tutorial at Hiroshima
Node.js Tutorial at HiroshimaNode.js Tutorial at Hiroshima
Node.js Tutorial at HiroshimaYoshihiro Iwanaga
 
TypeScriptへの入口
TypeScriptへの入口TypeScriptへの入口
TypeScriptへの入口Sunao Tomita
 
新入社員のための大規模ゲーム開発入門 サーバサイド編
新入社員のための大規模ゲーム開発入門 サーバサイド編新入社員のための大規模ゲーム開発入門 サーバサイド編
新入社員のための大規模ゲーム開発入門 サーバサイド編infinite_loop
 
大規模ソーシャルゲーム開発から学んだPHP&MySQL実践テクニック
大規模ソーシャルゲーム開発から学んだPHP&MySQL実践テクニック大規模ソーシャルゲーム開発から学んだPHP&MySQL実践テクニック
大規模ソーシャルゲーム開発から学んだPHP&MySQL実践テクニックinfinite_loop
 
大規模ソーシャルゲームを支える技術~PHP+MySQLを使った高負荷対策~
大規模ソーシャルゲームを支える技術~PHP+MySQLを使った高負荷対策~大規模ソーシャルゲームを支える技術~PHP+MySQLを使った高負荷対策~
大規模ソーシャルゲームを支える技術~PHP+MySQLを使った高負荷対策~infinite_loop
 
CEDEC2013 ソーシャルゲームの開発現場でUXについて思いっきりあがいてみた1年間の話
CEDEC2013 ソーシャルゲームの開発現場でUXについて思いっきりあがいてみた1年間の話CEDEC2013 ソーシャルゲームの開発現場でUXについて思いっきりあがいてみた1年間の話
CEDEC2013 ソーシャルゲームの開発現場でUXについて思いっきりあがいてみた1年間の話Takahiro YAMAGUCHI
 

Viewers also liked (20)

[大図解]ピグライフはこう動いている
[大図解]ピグライフはこう動いている[大図解]ピグライフはこう動いている
[大図解]ピグライフはこう動いている
 
Node.js を選ぶとき 選ばないとき
Node.js を選ぶとき 選ばないときNode.js を選ぶとき 選ばないとき
Node.js を選ぶとき 選ばないとき
 
Node.js入門
Node.js入門Node.js入門
Node.js入門
 
Node.js×mongo dbで3年間サービス運用してみた話
Node.js×mongo dbで3年間サービス運用してみた話Node.js×mongo dbで3年間サービス運用してみた話
Node.js×mongo dbで3年間サービス運用してみた話
 
Node.js基礎の基礎 - Miyazaki.js vol.2
Node.js基礎の基礎 - Miyazaki.js vol.2Node.js基礎の基礎 - Miyazaki.js vol.2
Node.js基礎の基礎 - Miyazaki.js vol.2
 
しごとで使うTitanium 第2版
しごとで使うTitanium 第2版しごとで使うTitanium 第2版
しごとで使うTitanium 第2版
 
Node js 入門
Node js 入門Node js 入門
Node js 入門
 
Nodeについて
NodeについてNodeについて
Nodeについて
 
イベント駆動プログラミングとI/O多重化
イベント駆動プログラミングとI/O多重化イベント駆動プログラミングとI/O多重化
イベント駆動プログラミングとI/O多重化
 
Japan 2011: Dreams will never die & Ganbaro Nippon
Japan 2011: Dreams will never die & Ganbaro Nippon Japan 2011: Dreams will never die & Ganbaro Nippon
Japan 2011: Dreams will never die & Ganbaro Nippon
 
Shinjuku.rb 20151125 PayPal 101
Shinjuku.rb 20151125 PayPal 101Shinjuku.rb 20151125 PayPal 101
Shinjuku.rb 20151125 PayPal 101
 
コンポーネント単位で考えるWeb制作
コンポーネント単位で考えるWeb制作コンポーネント単位で考えるWeb制作
コンポーネント単位で考えるWeb制作
 
パーフェクト"Elixir情報収集"
パーフェクト"Elixir情報収集"パーフェクト"Elixir情報収集"
パーフェクト"Elixir情報収集"
 
API Meetup #8 PayPal API
API Meetup #8 PayPal APIAPI Meetup #8 PayPal API
API Meetup #8 PayPal API
 
Node.js Tutorial at Hiroshima
Node.js Tutorial at HiroshimaNode.js Tutorial at Hiroshima
Node.js Tutorial at Hiroshima
 
TypeScriptへの入口
TypeScriptへの入口TypeScriptへの入口
TypeScriptへの入口
 
新入社員のための大規模ゲーム開発入門 サーバサイド編
新入社員のための大規模ゲーム開発入門 サーバサイド編新入社員のための大規模ゲーム開発入門 サーバサイド編
新入社員のための大規模ゲーム開発入門 サーバサイド編
 
大規模ソーシャルゲーム開発から学んだPHP&MySQL実践テクニック
大規模ソーシャルゲーム開発から学んだPHP&MySQL実践テクニック大規模ソーシャルゲーム開発から学んだPHP&MySQL実践テクニック
大規模ソーシャルゲーム開発から学んだPHP&MySQL実践テクニック
 
大規模ソーシャルゲームを支える技術~PHP+MySQLを使った高負荷対策~
大規模ソーシャルゲームを支える技術~PHP+MySQLを使った高負荷対策~大規模ソーシャルゲームを支える技術~PHP+MySQLを使った高負荷対策~
大規模ソーシャルゲームを支える技術~PHP+MySQLを使った高負荷対策~
 
CEDEC2013 ソーシャルゲームの開発現場でUXについて思いっきりあがいてみた1年間の話
CEDEC2013 ソーシャルゲームの開発現場でUXについて思いっきりあがいてみた1年間の話CEDEC2013 ソーシャルゲームの開発現場でUXについて思いっきりあがいてみた1年間の話
CEDEC2013 ソーシャルゲームの開発現場でUXについて思いっきりあがいてみた1年間の話
 

Similar to Node.js + MongoDB at Mongo Tokyo 2011

MongoDB Live Hacking
MongoDB Live HackingMongoDB Live Hacking
MongoDB Live HackingTobias Trelle
 
Mongoskin - Guilin
Mongoskin - GuilinMongoskin - Guilin
Mongoskin - GuilinJackson Tian
 
Introduction to MongoDB
Introduction to MongoDBIntroduction to MongoDB
Introduction to MongoDBMike Dirolf
 
Building Apps with MongoDB
Building Apps with MongoDBBuilding Apps with MongoDB
Building Apps with MongoDBNate Abele
 
みゆっき☆Think#7 「本気で学ぶJavascript」
みゆっき☆Think#7 「本気で学ぶJavascript」みゆっき☆Think#7 「本気で学ぶJavascript」
みゆっき☆Think#7 「本気で学ぶJavascript」techtalkdwango
 
第7回みゆっき☆Think 本気で学ぶ JavaScript
第7回みゆっき☆Think 本気で学ぶ JavaScript第7回みゆっき☆Think 本気で学ぶ JavaScript
第7回みゆっき☆Think 本気で学ぶ JavaScriptTakuya Fujimura
 
MongoDB at FrozenRails
MongoDB at FrozenRailsMongoDB at FrozenRails
MongoDB at FrozenRailsMike Dirolf
 
PostgreSQLからMongoDBへ
PostgreSQLからMongoDBへPostgreSQLからMongoDBへ
PostgreSQLからMongoDBへBasuke Suzuki
 
HadoopとMongoDBを活用したソーシャルアプリのログ解析
HadoopとMongoDBを活用したソーシャルアプリのログ解析HadoopとMongoDBを活用したソーシャルアプリのログ解析
HadoopとMongoDBを活用したソーシャルアプリのログ解析Takahiro Inoue
 
MongoDB, PHP and the cloud - php cloud summit 2011
MongoDB, PHP and the cloud - php cloud summit 2011MongoDB, PHP and the cloud - php cloud summit 2011
MongoDB, PHP and the cloud - php cloud summit 2011Steven Francia
 
Mongo db勉強会20110730
Mongo db勉強会20110730Mongo db勉強会20110730
Mongo db勉強会20110730Akihiro Okuno
 
MongoDB Performance Tuning
MongoDB Performance TuningMongoDB Performance Tuning
MongoDB Performance TuningMongoDB
 
Marc s01 e02-crud-database
Marc s01 e02-crud-databaseMarc s01 e02-crud-database
Marc s01 e02-crud-databaseMongoDB
 
Webinarserie: Einführung in MongoDB: “Back to Basics” - Teil 3 - Interaktion ...
Webinarserie: Einführung in MongoDB: “Back to Basics” - Teil 3 - Interaktion ...Webinarserie: Einführung in MongoDB: “Back to Basics” - Teil 3 - Interaktion ...
Webinarserie: Einführung in MongoDB: “Back to Basics” - Teil 3 - Interaktion ...MongoDB
 
ココロもつながるオンラインゲーム–アットゲームズ–のMongoDB導入事例
ココロもつながるオンラインゲーム–アットゲームズ–のMongoDB導入事例ココロもつながるオンラインゲーム–アットゲームズ–のMongoDB導入事例
ココロもつながるオンラインゲーム–アットゲームズ–のMongoDB導入事例Naoki Sega
 
Conceptos básicos. Seminario web 4: Indexación avanzada, índices de texto y g...
Conceptos básicos. Seminario web 4: Indexación avanzada, índices de texto y g...Conceptos básicos. Seminario web 4: Indexación avanzada, índices de texto y g...
Conceptos básicos. Seminario web 4: Indexación avanzada, índices de texto y g...MongoDB
 
MongoDB at ZPUGDC
MongoDB at ZPUGDCMongoDB at ZPUGDC
MongoDB at ZPUGDCMike Dirolf
 
NOSQL101, Or: How I Learned To Stop Worrying And Love The Mongo!
NOSQL101, Or: How I Learned To Stop Worrying And Love The Mongo!NOSQL101, Or: How I Learned To Stop Worrying And Love The Mongo!
NOSQL101, Or: How I Learned To Stop Worrying And Love The Mongo!Daniel Cousineau
 

Similar to Node.js + MongoDB at Mongo Tokyo 2011 (20)

ActiveRecord vs Mongoid
ActiveRecord vs MongoidActiveRecord vs Mongoid
ActiveRecord vs Mongoid
 
MongoDB Live Hacking
MongoDB Live HackingMongoDB Live Hacking
MongoDB Live Hacking
 
Mongoskin - Guilin
Mongoskin - GuilinMongoskin - Guilin
Mongoskin - Guilin
 
Introduction to MongoDB
Introduction to MongoDBIntroduction to MongoDB
Introduction to MongoDB
 
Building Apps with MongoDB
Building Apps with MongoDBBuilding Apps with MongoDB
Building Apps with MongoDB
 
みゆっき☆Think#7 「本気で学ぶJavascript」
みゆっき☆Think#7 「本気で学ぶJavascript」みゆっき☆Think#7 「本気で学ぶJavascript」
みゆっき☆Think#7 「本気で学ぶJavascript」
 
第7回みゆっき☆Think 本気で学ぶ JavaScript
第7回みゆっき☆Think 本気で学ぶ JavaScript第7回みゆっき☆Think 本気で学ぶ JavaScript
第7回みゆっき☆Think 本気で学ぶ JavaScript
 
MongoDB at FrozenRails
MongoDB at FrozenRailsMongoDB at FrozenRails
MongoDB at FrozenRails
 
PostgreSQLからMongoDBへ
PostgreSQLからMongoDBへPostgreSQLからMongoDBへ
PostgreSQLからMongoDBへ
 
HadoopとMongoDBを活用したソーシャルアプリのログ解析
HadoopとMongoDBを活用したソーシャルアプリのログ解析HadoopとMongoDBを活用したソーシャルアプリのログ解析
HadoopとMongoDBを活用したソーシャルアプリのログ解析
 
MongoDB, PHP and the cloud - php cloud summit 2011
MongoDB, PHP and the cloud - php cloud summit 2011MongoDB, PHP and the cloud - php cloud summit 2011
MongoDB, PHP and the cloud - php cloud summit 2011
 
Mongo db勉強会20110730
Mongo db勉強会20110730Mongo db勉強会20110730
Mongo db勉強会20110730
 
MongoDB Performance Tuning
MongoDB Performance TuningMongoDB Performance Tuning
MongoDB Performance Tuning
 
Marc s01 e02-crud-database
Marc s01 e02-crud-databaseMarc s01 e02-crud-database
Marc s01 e02-crud-database
 
Webinarserie: Einführung in MongoDB: “Back to Basics” - Teil 3 - Interaktion ...
Webinarserie: Einführung in MongoDB: “Back to Basics” - Teil 3 - Interaktion ...Webinarserie: Einführung in MongoDB: “Back to Basics” - Teil 3 - Interaktion ...
Webinarserie: Einführung in MongoDB: “Back to Basics” - Teil 3 - Interaktion ...
 
Latinoware
LatinowareLatinoware
Latinoware
 
ココロもつながるオンラインゲーム–アットゲームズ–のMongoDB導入事例
ココロもつながるオンラインゲーム–アットゲームズ–のMongoDB導入事例ココロもつながるオンラインゲーム–アットゲームズ–のMongoDB導入事例
ココロもつながるオンラインゲーム–アットゲームズ–のMongoDB導入事例
 
Conceptos básicos. Seminario web 4: Indexación avanzada, índices de texto y g...
Conceptos básicos. Seminario web 4: Indexación avanzada, índices de texto y g...Conceptos básicos. Seminario web 4: Indexación avanzada, índices de texto y g...
Conceptos básicos. Seminario web 4: Indexación avanzada, índices de texto y g...
 
MongoDB at ZPUGDC
MongoDB at ZPUGDCMongoDB at ZPUGDC
MongoDB at ZPUGDC
 
NOSQL101, Or: How I Learned To Stop Worrying And Love The Mongo!
NOSQL101, Or: How I Learned To Stop Worrying And Love The Mongo!NOSQL101, Or: How I Learned To Stop Worrying And Love The Mongo!
NOSQL101, Or: How I Learned To Stop Worrying And Love The Mongo!
 

Recently uploaded

"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr LapshynFwdays
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
"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
 
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
 
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
 
APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April  Automation LPDGAPIForce Zurich 5 April  Automation LPDG
APIForce Zurich 5 April Automation LPDGMarianaLemus7
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
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
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
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
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
"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
 
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
 
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
 

Recently uploaded (20)

Hot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort Service
Hot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort ServiceHot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort Service
Hot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort Service
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
"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...
 
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)
 
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?
 
APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April  Automation LPDGAPIForce Zurich 5 April  Automation LPDG
APIForce Zurich 5 April Automation LPDG
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
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
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
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
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
"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
 
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
 
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
 

Node.js + MongoDB at Mongo Tokyo 2011

  • 1.
  • 2. Mongo Tokyo 2011 - node.js + MongoDB
  • 3. Mongo Tokyo 2011 - node.js + MongoDB
  • 4. Mongo Tokyo 2011 - node.js + MongoDB
  • 5. Mongo Tokyo 2011 - node.js + MongoDB
  • 6. Mongo Tokyo 2011 - node.js + MongoDB
  • 7. Mongo Tokyo 2011 - node.js + MongoDB
  • 8. Mongo Tokyo 2011 - node.js + MongoDB
  • 9. Mongo Tokyo 2011 - node.js + MongoDB HTTP WebSocket Client (Flash) LB node.js 3x3 Sharding MongoDB Content SVN or git Distribution
  • 10. Mongo Tokyo 2011 - node.js + MongoDB
  • 11. Mongo Tokyo 2011 - node.js + MongoDB var entity = { _id: ‘abc’, name: ‘test’, body: { parts: { face: 0, eye: 2, nose: 4, mouth: 2 }, colors: { skin: 1, eye: 4, hair: 3 } } }; col.save(entity); col.findOne({_id:‘abc’}, function(err, result) { console.log(result.body.parts); }); col.update({_id:‘abc’}, {‘$set’, {name: ‘modified’}} );
  • 12. Mongo Tokyo 2011 - node.js + MongoDB https://github.com/orlandov/node-mongodb/ https://github.com/christkv/node-mongodb-native/
  • 13. Mongo Tokyo 2011 - node.js + MongoDB
  • 14. Mongo Tokyo 2011 - node.js + MongoDB var client = new Db('test', new Server("127.0.0.1", 27017, {})); client.open(function(err, p_client) { client.createCollection('test_insert',function(err, collection) { client.collection('test_insert', function(err, collection) { for(var i = 1; i < 1000; i++) { collection.insert({c:1}, function(err, docs) {}); } collection.insert({a:2}, function(err, docs) { collection.insert({a:3}, function(err, docs) { collection.count(function(err, count) { test.assertEquals(1001, count); collection.find(function(err, cursor) { cursor.toArray(function(err, results) { test.assertEquals(1001, results.length); test.assertTrue(results[0] != null); client.close(); }); }); }); }); }); }); }); });
  • 15. Mongo Tokyo 2011 - node.js + MongoDB
  • 16. Mongo Tokyo 2011 - node.js + MongoDB var db = new Database(‘127.0.0.1’, 3306, ‘test’); db.open(); var item = db.collection(‘item’); item .begin() .insert({_id:‘test’, name:‘abcdefg’}) .insert({_id:‘test2’, name:‘123456’, values:[0,1,2,3]); .update({_id:‘test’}, {‘$set’: { name: ‘hijklmn’ }) .find({}).each(function(entity) { console.log(entity.name); }) .success(function() { console.log(‘done’); }) .failure(function(err) { console.log(‘error’, err); }) .end();
  • 17. Mongo Tokyo 2011 - node.js + MongoDB https://github.com/LearnBoost/mongoose
  • 18. Mongo Tokyo 2011 - node.js + MongoDB
  • 19. Mongo Tokyo 2011 - node.js + MongoDB
  • 20. Mongo Tokyo 2011 - node.js + MongoDB
  • 21. Mongo Tokyo 2011 - node.js + MongoDB var spec1 = { name: ‘test’, type: ‘text’, label: ‘label-1’, class: ‘number’, min: 0, max: 100 }; var spec2 = { name: ‘test2’, type: ‘group’, label: ‘group-1’, fields: [spec3, spec4, spec5] }; var formSpec = [ spec1, spec2 ]; showForm(formSpec);
  • 22. Mongo Tokyo 2011 - node.js + MongoDB
  • 23. Mongo Tokyo 2011 - node.js + MongoDB
  • 24. Mongo Tokyo 2011 - node.js + MongoDB { "_id" : "plant_ichigo", "name" : " ", "type" : "plant", "plant" : { "tags" : [ "vegetable" ], "time" : { "grow" : 10, "expire" : 60 }, "rewards" : [ ! { ! ! "type" : "coin", ! ! "rate" : 1, ! ! "min" : 5, ! ! "max" : 20, ! ! "code" : "" ! }, ! { ! ! "type" : "exp", ! ! "rate" : 1, ! ! "min" : 1, ! ! "max" : 2, ! ! "code" : "" ! }, ! { ! ! "type" : "item", ! ! "rate" : 1, ! ! "min" : 1, ! ! "max" : 1, ! ! "code" : "material_ichigo" ! } ]}
  • 25. Mongo Tokyo 2011 - node.js + MongoDB