http://www.slideshare.net/doryokujin/mongodb-uimongodb
ScientificPython
// 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
      }
}{…
> 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,
    ...
> 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,
          …
      }
}
> 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,

        ...

    },...
}
> 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
    …
}
> 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         100356

3    ~(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

…
//

> access = getAccessData(“tutorial”,“2010-12-01”)
     UU   PATH
10000 /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
 …
http://www.slideshare.net/doryokujin/mongo-sharding
[08/May/2011:04:35:11 +0900]
db.collection.find(
 {date:20110517,
   userId:”1234”}
);
db.collection.insert(
 {hour:0,
   userId:”1234”,
   actionType:”login”,}
);
MongoDBで作るソーシャルデータ新解析基盤
MongoDBで作るソーシャルデータ新解析基盤
MongoDBで作るソーシャルデータ新解析基盤
MongoDBで作るソーシャルデータ新解析基盤
MongoDBで作るソーシャルデータ新解析基盤
MongoDBで作るソーシャルデータ新解析基盤
MongoDBで作るソーシャルデータ新解析基盤
MongoDBで作るソーシャルデータ新解析基盤
MongoDBで作るソーシャルデータ新解析基盤
MongoDBで作るソーシャルデータ新解析基盤
MongoDBで作るソーシャルデータ新解析基盤
MongoDBで作るソーシャルデータ新解析基盤
MongoDBで作るソーシャルデータ新解析基盤

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

  • 7.
  • 12.
  • 14.
    // 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 } }{…
  • 15.
    > 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, ...
  • 16.
    > 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, … } }
  • 17.
    > 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, ... },... }
  • 18.
    > 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 … }
  • 19.
    > 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 100356 3 ~(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 …
  • 20.
    // > access =getAccessData(“tutorial”,“2010-12-01”) UU PATH 10000 /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 …
  • 49.
  • 59.
  • 62.
  • 63.
    db.collection.insert( {hour:0, userId:”1234”, actionType:”login”,} );