Skip to content

Commit

Permalink
♻️ 微调代码
Browse files Browse the repository at this point in the history
  • Loading branch information
Goodjooy committed Aug 24, 2024
1 parent 634c3fe commit 872d6bf
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions persistence/dao/ceobe-operate/src/mongo/tool_link/retrieve.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use db_ops_prelude::{
futures::StreamExt,
futures::{StreamExt, TryStreamExt},
mongo_connection::{MongoDbCollectionTrait, MongoDbError},
mongodb::options::{CountOptions, FindOptions},
};
Expand Down Expand Up @@ -39,15 +39,12 @@ where
.limit(paginator.limit() as i64)
.build();

let mut cursor = db
let result = db
.doing(|collection| collection.find(None, find_options))
.await?
.try_collect()
.await?;

let mut result = Vec::<ToolLink>::new();
while let Some(doc) = cursor.next().await {
result.push(doc.map_err(MongoDbError::from)?)
}

Ok(result)
}

Expand Down

0 comments on commit 872d6bf

Please sign in to comment.