Skip to content

Commit

Permalink
fix: get_component_statuses
Browse files Browse the repository at this point in the history
  • Loading branch information
Huy-DNA committed May 12, 2024
1 parent 8021bc9 commit 3c9b031
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -443,6 +443,9 @@ async fn get_component_statuses(email: String, component_ids: Vec<usize>) -> Opt
}
}
},
doc! {
"$unwind": "$logs",
},
doc! {
"$replaceRoot": {
"newRoot": "$logs",
Expand All @@ -467,10 +470,10 @@ async fn get_component_statuses(email: String, component_ids: Vec<usize>) -> Opt
},
];

let mut cursor = fire_coll.aggregate(pipeline, None).await.ok()?;
let mut cursor = fire_coll.aggregate(pipeline, None).await.unwrap();
let mut res = vec![];
while cursor.advance().await.ok()? {
let document = cursor.deserialize_current().ok()?;
while cursor.advance().await.unwrap() {
let document = cursor.deserialize_current().unwrap();
res.push(bson::from_bson(document.into()).ok()?);
}

Expand Down

0 comments on commit 3c9b031

Please sign in to comment.