mongodb - How to deal with the timezone issue when storing dates in utc using mongod? -
i have mongodb collection each document has attributes , utc timestamp. need pull out data collection , use aggregation framework because use data collection display charts on user interface. however, need aggregation per user's timezone. assuming know user's timezone(passed in request browser or in other manner), there way use aggregation framework aggregate based on [client's] timezone?
what you're asking being discussed in mongodb issue server-6310.
i found in link a discussion thread.
the problem common grouping date, including sql databases , nosql databases. in fact, addressed head on in ravendb. there description of problem , ravendb solution here.
the mongodb issues discusses workaround, similar described in comments above. precalculate local times interested in, , group instead.
it difficult cover every time zone in world either approach. should decide on small handful of target zones make sense user base, such per-office approach described in ravendb article.
Comments
Post a Comment