-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added owners and tags in mappers
- Loading branch information
mrmx
committed
Jan 20, 2011
1 parent
773666f
commit 9e96d05
Showing
3 changed files
with
37 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
src/main/resources/org/mongoste/core/impl/mongodb/targetMapperM.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
function () { | ||
var k = {}; | ||
k.idc = this._idc;//EVENT_CLIENT_ID | ||
k.ida = this._ida;//EVENT_ACTION | ||
k.idk = this._idk;//EVENT_TARGET_TYPE | ||
k.idt = this._idt;//EVENT_TARGET | ||
k.own = this.own || [];//EVENT_TARGET_OWNERS | ||
k.tags = this.tags|| [];//EVENT_TARGET_TAGS | ||
var metaUnique = "ip"; | ||
for (var d in this.days) { | ||
var day = this.days[d]; | ||
for (var h in day.hours) { | ||
var hour = day.hours[h]; | ||
k.date = new Date(); | ||
k.date.setUTCFullYear(this.y); | ||
k.date.setUTCMonth(this.m-1); | ||
k.date.setUTCDate(1); | ||
k.date.setUTCHours(0); | ||
k.date.setUTCMinutes(0); | ||
k.date.setUTCSeconds(0); | ||
k.date.setUTCMilliseconds(0); | ||
for (var meta in hour.meta) { | ||
if(meta == metaUnique) { | ||
var muHour = hour.meta[metaUnique]; | ||
for (var mu in muHour) { | ||
emit(k, { count: 0 , unique : 1 }); | ||
} | ||
} | ||
} | ||
emit(k, { count : hour.count , unique : 0 }); | ||
} | ||
} | ||
} |