2 回答

TA貢獻1966條經驗 獲得超4個贊
以下默認基于mongo-go-driver
v1.1.x 和 MongoDB 服務器 v4.2。
ConnectTimeout? ? ? ? ?30 * time.Second
Compressors? ? ? ? ? ? nil (compression will not be used)
Dialer? ? ? ? ? ? ? ? ?net.Dialer with a 300 second keepalive time
HeartbeatInterval? ? ? 10 * time.Second
LocalThreshold? ? ? ? ?15 * time.Millisecond
MaxConnIdleTime? ? ? ? nil (no limit)
MaxPoolSize? ? ? ? ? ? 100
Monitor? ? ? ? ? ? ? ? nil
ReadConcern? ? ? ? ? ? nil (server default `local`)
ReadPreference? ? ? ? ?readpref.Primary()
Registry? ? ? ? ? ? ? ?bson.DefaultRegistry
RetryWrites? ? ? ? ? ? true
ServerSelectionTimeout 30 * time.Second
Direct? ? ? ? ? ? ? ? ?false
SocketTimeout? ? ? ? ? nil (infinite)
TLSConfig? ? ? ? ? ? ? nil
WriteConcern? ? ? ? ? ?nil (server default `w:1`)
ZlibLevel? ? ? ? ? ? ? 6 (if zlib compression enabled)

TA貢獻1852條經驗 獲得超7個贊
如果沒有流量設置默認值,則它將設置為零值。零值是當一個變量被聲明并且沒有顯式初始化時,它將被分配一個帶有默認值的存儲空間
ConnectTimeout --> time.Duration,數據類型默認值 = 0s b.
MaxPoolSize --> uint16,數據類型默認值 = 0
MaxConnIdleTime --> time.Duration,數據類型默認值 = 0s
其他 :
bool --> 默認值為 false
字符串 --> 默認值為“”
int ---> 默認值為 0
- 2 回答
- 0 關注
- 228 瀏覽
添加回答
舉報