MongoServerSettings Members

The MongoServerSettings type exposes the following members.

Collapse imageConstructors

 NameDescription
Public method
MongoServerSettings()()()()
Creates a new instance of MongoServerSettings. Usually you would use a connection string instead.
Public method
MongoServerSettings(ConnectionMode, TimeSpan, MongoCredentials, GuidRepresentation, Boolean, TimeSpan, TimeSpan, Int32, Int32, String, SafeMode, IEnumerable<(Of <<'(MongoServerAddress>)>>), Boolean, TimeSpan, Int32, TimeSpan)
Creates a new instance of MongoServerSettings. Usually you would use a connection string instead.

Collapse imageMethods

 NameDescription
Public method
Clone
Creates a clone of the settings.
Public method
Equals
Compares two MongoServerSettings instances.
(Overrides Object..::..Equals(Object).)
Protected method
Finalize
Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
(Inherited from Object.)
Public method
Freeze
Freezes the settings to prevent any further changes to them.
Public method
GetHashCode
Gets the hash code.
(Overrides Object..::..GetHashCode()()()().)
Public method
GetType
Gets the Type of the current instance.
(Inherited from Object.)
Protected method
MemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Public method
ToString
Returns a string representation of the settings.
(Overrides Object..::..ToString()()()().)

Collapse imageExtension Methods

 NameDescription
Public Extension Method
ToBson(Type)Overloaded.
Converts an object to a BSON document byte array.
(Defined by BsonExtensionMethods.)
Public Extension Method
ToBson(Type, IBsonSerializationOptions)Overloaded.
Converts an object to a BSON document byte array.
(Defined by BsonExtensionMethods.)
Public Extension Method
ToBson(Type, BsonBinaryWriterSettings)Overloaded.
Converts an object to a BSON document byte array.
(Defined by BsonExtensionMethods.)
Public Extension Method
ToBson(Type, IBsonSerializationOptions, BsonBinaryWriterSettings)Overloaded.
Converts an object to a BSON document byte array.
(Defined by BsonExtensionMethods.)
Public Extension Method
ToBsonDocument(Type)Overloaded.
Converts an object to a BsonDocument.
(Defined by BsonExtensionMethods.)
Public Extension Method
ToBsonDocument(Type, IBsonSerializationOptions)Overloaded.
Converts an object to a BsonDocument.
(Defined by BsonExtensionMethods.)
Public Extension Method
ToJson(Type)Overloaded.
Converts an object to a JSON string.
(Defined by BsonExtensionMethods.)
Public Extension Method
ToJson(Type, IBsonSerializationOptions)Overloaded.
Converts an object to a JSON string.
(Defined by BsonExtensionMethods.)
Public Extension Method
ToJson(Type, JsonWriterSettings)Overloaded.
Converts an object to a JSON string.
(Defined by BsonExtensionMethods.)
Public Extension Method
ToJson(Type, IBsonSerializationOptions, JsonWriterSettings)Overloaded.
Converts an object to a JSON string.
(Defined by BsonExtensionMethods.)

Collapse imageProperties

 NameDescription
Public property
AddressFamily
Gets the AddressFamily for the IPEndPoint (derived from the IPv6 setting).
Public property
ConnectionMode
Gets or sets the connection mode.
Public property
ConnectTimeout
Gets or sets the connect timeout.
Public property
DefaultCredentials
Gets or sets the default credentials.
Public property
GuidRepresentation
Gets or sets the representation to use for Guids.
Public property
IPv6
Gets or sets whether to use IPv6.
Public property
IsFrozen
Gets whether the settings have been frozen to prevent further changes.
Public property
MaxConnectionIdleTime
Gets or sets the max connection idle time.
Public property
MaxConnectionLifeTime
Gets or sets the max connection life time.
Public property
MaxConnectionPoolSize
Gets or sets the max connection pool size.
Public property
MinConnectionPoolSize
Gets or sets the min connection pool size.
Public property
ReplicaSetName
Gets or sets the name of the replica set.
Public property
SafeMode
Gets or sets the SafeMode to use.
Public property
Server
Gets or sets the address of the server (see also Servers if using more than one address).
Public property
Servers
Gets or sets the list of server addresses (see also Server if using only one address).
Public property
SlaveOk
Gets or sets whether queries should be sent to secondary servers.
Public property
SocketTimeout
Gets or sets the socket timeout.
Public property
WaitQueueSize
Gets or sets the wait queue size.
Public property
WaitQueueTimeout
Gets or sets the wait queue timeout.

Collapse imageSee Also

### Python 中 `__members__` 的定义与用法 在 Python 中,`__members__` 并不是一个官方文档中明确规定的特殊方法或属性。然而,在某些特定场景下,它可能被用于描述对象内部成员的状态或者作为类中的自定义实现的一部分。 #### 1. 历史背景 早期版本的 Python(如 Python 2.x),`__members__` 曾经是一个非正式的概念,主要用于调试目的。它可以用来列举某个对象的所有可访问属性[^1]。尽管如此,这种行为并未标准化,并且随着 Python 版本的发展逐渐被淘汰。 #### 2. 自定义用途 如果开发者希望模拟类似的机制,则可以通过手动设置 `__members__` 属性来达到目标。例如: ```python class MyClass: __slots__ = ('attr1', 'attr2') @property def __members__(self): return {slot: getattr(self, slot) for slot in self.__slots__} obj = MyClass() obj.attr1 = "value1" obj.attr2 = "value2" print(obj.__members__) # 输出 {'attr1': 'value1', 'attr2': 'value2'} ``` 上述代码展示了如何通过定义一个名为 `__members__` 的 property 方法返回当前实例的所有槽位及其对应的值[^2]。 #### 3. 调试工具中的隐含意义 虽然现代 Python 不再显式支持 `__members__`,但在一些第三方库或框架中可能会重新引入这一名称以提供额外功能。比如单元测试模块 unittest.mock 可能会间接利用类似命名约定帮助追踪 mock 对象的行为记录。 #### 性能优化建议 当考虑扩展此类特性时,请务必注意性能开销。对于大规模数据结构操作而言,频繁调用复杂的 getter 函数可能导致效率下降。因此应当遵循如下原则: - 尽量简化逻辑流程; - 避免不必要的内存分配动作; - 提升程序启动速度以及渲染表现等[^3]。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

微笑点燃希望

你的鼓励是我创作最大的动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值