fix: use correct keys for index
This commit is contained in:
parent
bf562c8354
commit
1934241057
|
@ -26,6 +26,7 @@ pub struct PartyFinderListing {
|
|||
pub min_item_level: u16,
|
||||
pub num_parties: u8,
|
||||
pub slots_available: u8,
|
||||
pub last_server_restart: u32,
|
||||
pub objective: ObjectiveFlags,
|
||||
pub conditions: ConditionFlags,
|
||||
pub duty_finder_settings: DutyFinderSettingsFlags,
|
||||
|
|
|
@ -45,7 +45,8 @@ impl State {
|
|||
IndexModel::builder()
|
||||
.keys(mongodb::bson::doc! {
|
||||
"listing.id": 1,
|
||||
"listing.content_id_lower": 1,
|
||||
"listing.last_server_restart": 1,
|
||||
"listing.created_world": 1,
|
||||
})
|
||||
.options(IndexOptions::builder()
|
||||
.unique(true)
|
||||
|
@ -239,6 +240,8 @@ fn contribute_multiple(state: Arc<State>) -> BoxedFilter<(impl Reply, )> {
|
|||
let result = insert_listing(&*state, listing).await;
|
||||
if result.is_ok() {
|
||||
successful += 1;
|
||||
} else {
|
||||
eprintln!("{:#?}", result);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -266,7 +269,8 @@ async fn insert_listing(state: &State, listing: PartyFinderListing) -> mongodb::
|
|||
.update_one(
|
||||
doc! {
|
||||
"listing.id": listing.id,
|
||||
"listing.content_id_lower": listing.content_id_lower,
|
||||
"listing.last_server_restart": listing.last_server_restart,
|
||||
"listing.created_world": listing.created_world as u32,
|
||||
},
|
||||
doc! {
|
||||
"$currentDate": {
|
||||
|
|
Loading…
Reference in New Issue