Upgrade dependent version: go.mongodb.org/mongo-driver (#5320)

Upgrade dependent version: go.mongodb.org/mongo-driver v1.3.2 -> v1.10.4

Signed-off-by: hongzhouzi <hongzhouzi@kubesphere.io>

Signed-off-by: hongzhouzi <hongzhouzi@kubesphere.io>
This commit is contained in:
hongzhouzi
2022-12-02 15:08:55 +08:00
committed by GitHub
parent 493586d9a6
commit 0ca413cea3
61 changed files with 3025 additions and 1695 deletions

View File

@@ -19,7 +19,7 @@ import (
)
func wrapperKeyBSONType(key string) bsontype.Type {
switch string(key) {
switch key {
case "$numberInt":
return bsontype.Int32
case "$numberLong":
@@ -46,12 +46,6 @@ func wrapperKeyBSONType(key string) bsontype.Type {
return bsontype.DBPointer
case "$date":
return bsontype.DateTime
case "$ref":
fallthrough
case "$id":
fallthrough
case "$db":
return bsontype.EmbeddedDocument // dbrefs aren't bson types
case "$minKey":
return bsontype.MinKey
case "$maxKey":
@@ -217,7 +211,7 @@ func parseDatetimeString(data string) (int64, error) {
return 0, fmt.Errorf("invalid $date value string: %s", data)
}
return t.Unix()*1e3 + int64(t.Nanosecond())/1e6, nil
return int64(primitive.NewDateTimeFromTime(t)), nil
}
func parseDatetimeObject(data *extJSONObject) (d int64, err error) {
@@ -275,7 +269,7 @@ func (ejv *extJSONValue) parseDouble() (float64, error) {
return 0, fmt.Errorf("$numberDouble value should be string, but instead is %s", ejv.t)
}
switch string(ejv.v.(string)) {
switch ejv.v.(string) {
case "Infinity":
return math.Inf(1), nil
case "-Infinity":
@@ -370,7 +364,7 @@ func (ejv *extJSONValue) parseRegex() (pattern, options string, err error) {
for i, key := range regexObj.keys {
val := regexObj.values[i]
switch string(key) {
switch key {
case "pattern":
if patFound {
return "", "", errors.New("duplicate pattern key in $regularExpression")