I'm very new to Mongo, and am just getting my head around the core concepts...I'm implementing a schema for time series data, and am planning to try the pattern suggested here: MongoDB as a Time Series Database, which has also appeared in some Mongo presentations.
I understand the schema, but am having difficulty working out how one might query it for a range of dates. More specifically, can someone show an example of how to query the schema at the link above to retrieve a 1-minute series that spans multiple hours/days? Ideally, without the need for post processing outside of Mongo.
The Mongo docs and aggregation pipeline appear mostly concerned with processing arrays rather than nested subdocuments...TIA.
EDIT: To add more clarity to the specific problem I'm trying to solve...
Let's say I'm storing data in 1 minute intervals, with one parent document per day, using the following schema (snipped from the post linked to above):
{
timestamp_hour: ISODate("2013-10-10T23:00:00.000Z"),
type: “spot_EURUSD”,
values: {
0: { 0: 1.2343, 1: 1.2343, …, 59: 1.2343},
1: { 0: 1.2343, 1: 1.2343, …, 59: 1.2343},
…,
22: { 0: 1.2343, 1: 1.2343, …, 59: 1.2343},
23: { 0: 1.2343, 1: 1.2343, …, 59: 1.2343}
}
}
What would be the most effective/efficient way to satisfy queries of the form: "Give me a chronological list of values, 1 per minute, starting on 2013-09-25 at 1:37pm, and ending on 2013-10-15 at 2:56pm"?