MongoDBで作るソーシャルデータ新解析基盤

45,954 views

Published on

Published in: Technology, Education
0 Comments
27 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
45,954
On SlideShare
0
From Embeds
0
Number of Embeds
37,578
Actions
Shares
0
Downloads
130
Comments
0
Likes
27
Embeds 0
No embeds

No notes for slide

MongoDBで作るソーシャルデータ新解析基盤

  1. 1. http://www.slideshare.net/doryokujin/mongodb-uimongodb
  2. 2. ScientificPython
  3. 3. // 11/10 TOP10> db.user_charge.find({date:"2010-11-10"}) .sort({totalCharge:-1}).limit(10).forEach(printjson){ "_id" : "2010-11-10+7777+Charge", "date" : "2010-11-10", "lastUpdate" : "2010-11-10", "totalCharge" : 10000, "userId" : ”7777", "actionType" : "Charge", "boughtItem" : { " EX" : 13, " +6000" : 3, " PRO" : 20 }}{…
  4. 4. > db.daily_charge.find({date:"2010-11-10",T:"all"}) .limit(10).forEach(printjson){ "_id" : "2010-11-10+group+Charge+all+all", "date" : "2010-11-10", "total" : 100000, "UU" : 2000, "group" : { " " : 1000000, " " : 1000000, ... }, "boughtItemNum" : { " EX" : 8, " " : 730, ... }, "boughtItem" : { " EX" : 10000, " " : 100000, ...
  5. 5. > db.user_trace.find({date:"2010-11-10”,actionType: "a{Make}",userId:”7777"}).limit(10).forEach(printjson){ "_id" : "2010-11-10+7777+a{Make}", "date" : "2010-11-10" "lastUpdate" : "2010-11-11", "userId" : ”7777", "actionType" : "a{Make}", "actionDetail" : { "make item ksutera" : 3, "make item makaron" : 1, "make item huwahuwamimiate" : 1, "make item ringoame" : 3, … }}
  6. 6. > db.daily_trace.find( {date:{$gte:"2010-11-10”,$lte:”2010-11-20”},actionType:"a{Make}"} ).limit(10).forEach(printjson){ "_id" : "2010-11-10+group+a{Make}", "date" : "2010-11-10", "lastUpdate" : "2010-11-12", "actionType" : "a{Make}", "actionDetail" : { "make item kinnokarakuridokei" : 615, "make item banjo-" : 377, "make item itigoke-ki" : 135904, "make item wadaikoan" : 40, "make item ha-pu" : 11, ... },...}
  7. 7. > db.user_registration.find({userId:”7777"}).forEach(printjson){ "_id" : "2010-06-29+7777+Registration", "userId" : “7777" "actionType" : "Registration", "category" : { R1” : “True”, # 1 = True “T” : “ll” # … }, “tag”:[“longTerm”,”highFreq”], # “firstCharge” : “2010-07-07”, # “lastLogin” : “2010-09-30”, # “playTerm” : 94, # “totalCumlativeCharge” : 50000, # “totalMonthCharge” : 10000, # 1 …}
  8. 8. > var cross = new Cross() //// ×> MCResign = cross.calc(“2010-10-08”,“MC”,1) / 0 (z) ~1000 (s) ~10000 (m) 10000 ~(l)~1 (z) 50000 10 5 0 50015~1 (s) 50000 100 50 3 50153~1 (m) 100000 200 100 1 100301~3 (l) 100000 300 50 6 1003563 ~(ll) 0 0 0 0 0// ×> MCNotResign = cross.calc("2010-10-08","MC",-1) / 0 (z) ~1000 (s) ~10000 (m) 10000 ~(l)~1 (z) 50000 10 5 0 50015…
  9. 9. //> access = getAccessData(“tutorial”,“2010-12-01”) UU PATH10000 /playshop2-gree/tutorial/FirstTopPage 9500 /playshop2-gree/tutorial/Tutorial01Page 8000 /playshop2-gree/tutorial/Tutorial02Page 7700 /playshop2-gree/tutorial/Tutorial03Page 7000 /playshop2-gree/tutorial/Tutorial04Page 4000 /playshop2-gree/tutorial/make/avatar 3800 /playshop2-gree/tutorial/Tutorial05Page …
  10. 10. http://www.slideshare.net/doryokujin/mongo-sharding
  11. 11. [08/May/2011:04:35:11 +0900]
  12. 12. db.collection.find( {date:20110517, userId:”1234”});
  13. 13. db.collection.insert( {hour:0, userId:”1234”, actionType:”login”,});

×