diff --git a/datastore-mongodb/src/main/java/org/opencb/datastore/mongodb/MongoDBNativeQuery.java b/datastore-mongodb/src/main/java/org/opencb/datastore/mongodb/MongoDBNativeQuery.java
index <HASH>..<HASH> 100644
--- a/datastore-mongodb/src/main/java/org/opencb/datastore/mongodb/MongoDBNativeQuery.java
+++ b/datastore-mongodb/src/main/java/org/opencb/datastore/mongodb/MongoDBNativeQuery.java
@@ -145,12 +145,17 @@ public class MongoDBNativeQuery {
 
             BulkWriteRequestBuilder builder = bulk.find(query);
             if (upsert) {
-                builder.upsert();
-            }
-            if (multi) {
-                builder.update(update);
+                if (multi) {
+                    builder.upsert().update(update);
+                } else {
+                    builder.upsert().updateOne(update);
+                }
             } else {
-                builder.updateOne(update);
+                if (multi) {
+                    builder.update(update);
+                } else {
+                    builder.updateOne(update);
+                }
             }
         }
         return bulk.execute();
mongodb: Bugfixed, bulk insert was ignoring upsert option.