Last active
December 19, 2015 18:29
-
-
Save misablaha/5999423 to your computer and use it in GitHub Desktop.
Struktura agregovanych dat
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
// struktura dokumentu se da prealokovat jiz pri zakladani | |
// ... dokumenty bude nutne zakladat zvlastnim scriptem mimo aggregatory | |
// ... pri zakladani primo v aggregatoru bysme museli overovat existenci dokumentu | |
// co kdyz se page prestane v nejakem offsetu pocitat? | |
// ... nechame ho tam | |
// !!!! pri zmene offsetu v timezone bude pro frontend potreba cist 4 dokumenty misto standardnich 2 !!!! | |
// ... data se budou cist najednou {"_id": {"$in": ["99991509734#201306T-04", "99991509734#201306T-05"]} | |
// ... dvakret se bude nacitat jen mesic, ve kterem se meni cas - tedy ne 4, ale 3 dokumenty | |
{ | |
// page_id + "#" + rok + mesic + "T" + time offset | |
// lze hledat regularem {"_id": /^99991509734#/} - mongo pouzije index | |
"_id": "99991509734#201306T+00", | |
// den v mesici | |
"01": { | |
"l":0, | |
"p":1, | |
"s":0, | |
"e":0.5 | |
}, | |
"02": { | |
"l":0, | |
"p":1, | |
"s":0, | |
"e":0.5 | |
} | |
} | |
{ | |
"_id": "99991509734#201306T-04", | |
"01": { | |
"l":0, | |
"p":1, | |
"s":0, | |
"e":0.5 | |
}, | |
"02": { | |
"l":0, | |
"p":1, | |
"s":0, | |
"e":0.5 | |
} | |
} |
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
// struktura dokumentu se da prealokovat jiz pri zakladani | |
// ... dokumenty bude nutne zakladat zvlastnim scriptem mimo aggregatory | |
// ... pri zakladani primo v aggregatoru bysme museli overovat existenci dokumentu | |
{ | |
// page_id + "#" + rok + mesic + "T" + time offset | |
// lze hledat regularem {"_id": /^99991509734#/} - mongo pouzije index | |
"_id": "99991509734#201306", | |
// den v mesici + hodina | |
"0101": { | |
"l":0, | |
"p":1, | |
"s":0, | |
"e":0.5 | |
}, | |
"0102": { | |
"l":0, | |
"p":1, | |
"s":0, | |
"e":0.5 | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment