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:
14
vendor/go.mongodb.org/mongo-driver/bson/bsonrw/extjson_wrappers.go
generated
vendored
14
vendor/go.mongodb.org/mongo-driver/bson/bsonrw/extjson_wrappers.go
generated
vendored
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user