mongodb - Designing a database for querying by dates? -


for example, need query last 6 months earliest instance each day (and last day earliest instances in each hours, , last day minutes). thinking of using mongodb , having nested structure like

year:{ month:{ day: { hour: { minute: [array of seconds] 

but first instance have sort array costly. there easier way?

would better have date field.

and query like:

find(date: {$gt : 'starting_date', $lt : 'ending_date'}) 

Comments

Popular posts from this blog

jquery - How can I dynamically add a browser tab? -

keyboard - C++ GetAsyncKeyState alternative -

android - java.net.UnknownHostException(Unable to resolve host “URL”: No address associated with hostname) -