From 542672370376e17b84c93205532c9a441fd781ab Mon Sep 17 00:00:00 2001 From: Mike Pollard Date: Tue, 12 May 2020 17:16:37 +0100 Subject: [PATCH] Fix mongoc_bulk_operation_execute error detection. Non-zero return is fine. --- Sources/PerfectMongoDB/MongoCollection.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sources/PerfectMongoDB/MongoCollection.swift b/Sources/PerfectMongoDB/MongoCollection.swift index b866dff..75e80de 100644 --- a/Sources/PerfectMongoDB/MongoCollection.swift +++ b/Sources/PerfectMongoDB/MongoCollection.swift @@ -412,7 +412,7 @@ public class MongoCollection { // bson_destroy(sdoc) // bson_destroy(udoc) } - guard mongoc_bulk_operation_execute(bulk, toOpaque(&reply), &error) == 1 else { + guard mongoc_bulk_operation_execute(bulk, toOpaque(&reply), &error) != 0 else { return Result.fromError(error) } return .success