diff --git a/query-engine/connectors/mongodb-query-connector/src/root_queries/write.rs b/query-engine/connectors/mongodb-query-connector/src/root_queries/write.rs index 40d385bfad5..e2304740e3a 100644 --- a/query-engine/connectors/mongodb-query-connector/src/root_queries/write.rs +++ b/query-engine/connectors/mongodb-query-connector/src/root_queries/write.rs @@ -236,7 +236,7 @@ pub async fn delete_records<'conn>( let ids = if let Some(selectors) = record_filter.selectors { selectors .into_iter() - .take(limit.unwrap_or(std::i64::MAX) as usize) + .take(limit.unwrap_or(i64::MAX) as usize) .map(|p| { (&id_field, p.values().next().unwrap()) .into_bson() diff --git a/query-engine/core/src/interpreter/query_interpreters/write.rs b/query-engine/core/src/interpreter/query_interpreters/write.rs index 53de1a18b40..083cf238cae 100644 --- a/query-engine/core/src/interpreter/query_interpreters/write.rs +++ b/query-engine/core/src/interpreter/query_interpreters/write.rs @@ -337,7 +337,9 @@ async fn delete_many( q: DeleteManyRecords, traceparent: Option, ) -> InterpretationResult { - let res = tx.delete_records(&q.model, q.record_filter, q.limit, traceparent).await?; + let res = tx + .delete_records(&q.model, q.record_filter, q.limit, traceparent) + .await?; Ok(QueryResult::Count(res)) } diff --git a/query-engine/core/src/query_graph_builder/write/delete.rs b/query-engine/core/src/query_graph_builder/write/delete.rs index f760f9c82ea..b0c43d3d5ad 100644 --- a/query-engine/core/src/query_graph_builder/write/delete.rs +++ b/query-engine/core/src/query_graph_builder/write/delete.rs @@ -111,7 +111,9 @@ pub fn delete_many_records( Some(where_arg) => extract_filter(where_arg.value.try_into()?, &model)?, None => Filter::empty(), }; - let limit = field.arguments.lookup(args::LIMIT) + let limit = field + .arguments + .lookup(args::LIMIT) .and_then(|limit_arg| match limit_arg.value { ParsedInputValue::Single(PrismaValue::Int(i)) => Some(i), _ => None,