Platforms to show: All Mac Windows Linux Cross-Platform

MongoBulkOperationMBS class   New in 26.4

Type Topic Plugin Version macOS Windows Linux iOS Targets
class MongoDB MBS MongoDB Plugin 26.4 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Provides an abstraction for submitting multiple write operations as a single batch.
Example
Var bulk As New MongoBulkOperationMBS(Collection)

// add a record
Var NewRecord As New JSONItem
NewRecord.Value("firstName") = "John"
NewRecord.Value("lastName") = "Miller"
NewRecord.Value("city") = "New York"
NewRecord.Value("phone") = "555-1111-111"

bulk.Insert(NewRecord.toString)


// and a second record
NewRecord = new JSONItem
NewRecord.Value("firstName") = "Bob"
NewRecord.Value("lastName") = "Jones"
NewRecord.Value("city") = "Los Angeles"
NewRecord.Value("phone") = "555-1234-567"

bulk.Insert(NewRecord.toString)


// now send both together
Var result As String = bulk.Execute

// e.g. { "nInserted" : 2, "nMatched" : 0, "nModified" : 0, "nRemoved" : 0, "nUpserted" : 0, "writeErrors" : [ ] }

MessageBox "Successful at server "+bulk.UsedServerId.ToString + EndOfLine + EndOfLine + result

After adding all of the write operations to the operation, call Execute() to execute the operation.

This class has no sub classes.

Blog Entries

Release notes

  • Version 26.4
    • Added MongoBulkOperationMBS class.

Some related classes:


The items on this page are in the following plugins: MBS MongoDB Plugin.


MLUpdateTaskMBS   -   MongoChangeStreamMBS


The biggest plugin in space...