All:
Im pretty new to MongoDB, I wonder if I want to search document by a date range, how can i do that? So, the question will be:
[1] How can I insert the data?
My data object is like:
{
value: 10,
date: "20150121"
}
I want to know how can I preprocess the date field before insert it
[2] How can I search a certain range docuemnts?
I am thinking using something like:
db.collection.find( { date: { $gt: date1, $lt: date2 } } );
But I am not sure.
Thanks