fix: filter on updated date, not created date

This commit is contained in:
Anna 2021-11-28 17:03:27 -05:00
parent 51697619e7
commit 96f663137d
1 changed files with 3 additions and 3 deletions

View File

@ -83,13 +83,13 @@ impl State {
.create_index(
IndexModel::builder()
.keys(mongodb::bson::doc! {
"created_at": 1,
"updated_at": 1,
})
.build(),
None,
)
.await
.context("could not create created_at index")?;
.context("could not create updated_at index")?;
let task_state = Arc::clone(&state);
tokio::task::spawn(async move {
@ -233,7 +233,7 @@ fn listings(state: Arc<State>) -> BoxedFilter<(impl Reply, )> {
// },
doc! {
"$match": {
"created_at": { "$gte": two_hours_ago },
"updated_at": { "$gte": two_hours_ago },
}
},
doc! {