We are using firebase realtime db and have orders data. the date is stored as a string value and we are looking to query like orders in last one week. The data look like
"orders" : {
"-LM_h6nKUKQY0wyqSCz4" : {
"order" : {
"_couponDiscount" : "382.5",
"_date" : "17-9-2018",
"_orderNumber" : "MannuSharma-21581",
"_orderStatus" : "Delivered",
"_orderTotal" : 450,
}
},
"-LMatbq6prD4kNtTqzmx" : {
"order" : {
"_date" : "19-9-2018",
"_orderNumber" : "AnkushVerma-22991",
"_orderStatus" : "Delivered",
"_orderTotal" : 600,
}
},
"-LMaxcGocVxe9nnfFnT2" : {
"order" : {
"_date" : "18-9-2018",
"_orderNumber" : "MannuSharma-40284",
"_orderStatus" : "Delivered",
"_orderTotal" : 450,
}
}
The _date is the field and in this case lets say i need to get data fro date 17 and 18th.
the startAt and endAt will do it lexographically it seems, so how do i get this data treated as date?