@@ -54,29 +54,29 @@ public function statementCount(){
5454 public function actorCount (){
5555 $ count_array = ['mbox ' => '' , 'openid ' => '' , 'mbox_sha1sum ' => '' , 'account ' => '' ];
5656
57- $ count_array ['mbox ' ] = $ this ->db ->statements ->aggregate (
58- ['$match ' => $ this -> getMatch ( $ this ->lrs ) ],
59- ['$group ' => ['_id ' => '$statement.actor.mbox ' ]],
60- ['$group ' => ['_id ' => 1 , 'count ' => ['$sum ' => 1 ]]]
61- );
57+ $ count_array ['mbox ' ] = $ this ->db ->statements ->aggregate ([
58+ ['$match ' => [ ' lrs._id ' => $ this ->lrs , ' statement.actor.mbox ' => [ ' $exists ' => true ]] ],
59+ ['$group ' => ['_id ' => '$statement.actor.mbox ' ]],
60+ ['$group ' => ['_id ' => 1 , 'count ' => ['$sum ' => 1 ]]]
61+ ] );
6262
63- $ count_array ['openid ' ] = $ this ->db ->statements ->aggregate (
64- ['$match ' => $ this -> getMatch ( $ this ->lrs ) ],
65- ['$group ' => ['_id ' => '$statement.actor.openid ' ]],
66- ['$group ' => ['_id ' => 1 , 'count ' => ['$sum ' => 1 ]]]
67- );
63+ $ count_array ['openid ' ] = $ this ->db ->statements ->aggregate ([
64+ ['$match ' => [ ' lrs._id ' => $ this ->lrs , ' statement.actor.openid ' => [ ' $exists ' => true ]] ],
65+ ['$group ' => ['_id ' => '$statement.actor.openid ' ]],
66+ ['$group ' => ['_id ' => 1 , 'count ' => ['$sum ' => 1 ]]]
67+ ] );
6868
69- $ count_array ['mbox_sha1sum ' ] = $ this ->db ->statements ->aggregate (
70- ['$match ' => $ this -> getMatch ( $ this ->lrs ) ],
71- ['$group ' => ['_id ' => '$statement.actor.mbox_sha1sum ' ]],
72- ['$group ' => ['_id ' => 1 , 'count ' => ['$sum ' => 1 ]]]
73- );
69+ $ count_array ['mbox_sha1sum ' ] = $ this ->db ->statements ->aggregate ([
70+ ['$match ' => [ ' lrs._id ' => $ this ->lrs , ' statement.actor.mbox_sha1sum ' => [ ' $exists ' => true ]] ],
71+ ['$group ' => ['_id ' => '$statement.actor.mbox_sha1sum ' ]],
72+ ['$group ' => ['_id ' => 1 , 'count ' => ['$sum ' => 1 ]]]
73+ ] );
7474
75- $ count_array ['account ' ] = $ this ->db ->statements ->aggregate (
76- ['$match ' => $ this -> getMatch ( $ this ->lrs ) ],
77- ['$group ' => ['_id ' => ['accountName ' => '$statement.actor.account.name ' , 'accountHomePage ' => '$statement.actor.account.homePage ' ]]],
78- ['$group ' => ['_id ' => 1 , 'count ' => ['$sum ' => 1 ]]]
79- );
75+ $ count_array ['account ' ] = $ this ->db ->statements ->aggregate ([
76+ ['$match ' => [ ' lrs._id ' => $ this ->lrs , ' statement.actor.account ' => [ ' $exists ' => true ]] ],
77+ ['$group ' => ['_id ' => ['accountName ' => '$statement.actor.account.name ' , 'accountHomePage ' => '$statement.actor.account.homePage ' ]]],
78+ ['$group ' => ['_id ' => 1 , 'count ' => ['$sum ' => 1 ]]]
79+ ] );
8080
8181 $ summary = 0 ;
8282 foreach ($ count_array as $ key => $ val ) {
0 commit comments