Documentation
¶
Index ¶
- func FormTimeOfTimeZone(pt time.Time, zone string) time.Time
- func FormatPrimitiveTimeOfTimeZone(pt primitive.DateTime, zone string) time.Time
- func ObjectIDFromHex(id string) primitive.ObjectID
- func StructToBSONM(v interface{}, ignoreZeroValue bool, tagName string) bson.M
- func StructToUpdateBSON(v interface{}, ignoreZeroValue bool) bson.D
- type DocumentPartitionHelper
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ObjectIDFromHex ¶
func StructToBSONM ¶
StructToBSONM 将结构体转换为 bson.M 参数:
- v: 要转换的结构体
- ignoreZeroValue: 是否忽略零值字段
- tagName: 要使用的标签名称,通常是 "bson"
func StructToUpdateBSON ¶
辅助函数:将结构体转化为用于更新的 bson.D(带有 $set 操作符)
Types ¶
type DocumentPartitionHelper ¶
type DocumentPartitionHelper struct {
// contains filtered or unexported fields
}
func NewDefPartitionHelper ¶
func NewDefPartitionHelper(tableName string, sizes ...int) *DocumentPartitionHelper
func NewDocumentPartitionHelper ¶
func NewDocumentPartitionHelper(replicas, ringSize int, tableBaseName string) *DocumentPartitionHelper
func (*DocumentPartitionHelper) GetCollName ¶
func (r *DocumentPartitionHelper) GetCollName(key string) string
GetMessageName 获取Key对应的节点
Click to show internal directories.
Click to hide internal directories.