Components All New MacOS Windows Linux iOS
Examples Mac & Win Server Client Guides Statistic FMM Blog Deprecated Old

MongoDB.BulkOperation.SetServerId

Specifies which server to use for the operation.

Component Version macOS Windows Linux Server iOS SDK
MongoDB 16.4 ✅ Yes ✅ Yes ✅ Yes ✅ Yes ✅ Yes
MBS( "MongoDB.BulkOperation.SetServerId"; MongoDBRef; ServerId )   More

Parameters

Parameter Description Example
MongoDBRef The reference number for the mongo connection. $MongoDB
ServerId Which server to use.
Default is 0 for none.

Result

Returns OK or error.

Description

Specifies which server to use for the operation.
This function has an effect only if called before MongoDB.BulkOperation.Execute.

When writing applications, leave the server id unset and allow the driver to choose a suitable server for the bulk operation.

See also

This function is free to use.

Created 9th August 2026, last changed 9th August 2026


MongoDB.BulkOperation.SetLet - MongoDB.BulkOperation.UpdateMany


MarkDown version: MongoDBBulkOperationSetServerId.md