Sub UpdateOrInsert (Collection As MongoCollection, Filter As Map, Update As Map) As UpdateResult
Dim jco As JavaObject = Collection
Dim utils As JavaObject
utils.InitializeStatic("anywheresoftware.mongo.MongoUtils")
Dim options As JavaObject
options.InitializeNewInstance("com.mongodb.client.model.UpdateOptions", Null)
options.RunMethod("upsert", Array(True))
Return jco.RunMethod("updateMany", Array( _
utils.RunMethod("MapToBson", Array(Filter)), _
utils.RunMethod("MapToBson", Array(Update)), _
options))
End Sub