updated mongo driver dependencies to v2
Build Docker and Deploy / Run goext test-suite (push) Failing after 1m27s
Build Docker and Deploy / Run goext test-suite (push) Failing after 1m27s
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
package mongoext
|
||||
|
||||
import (
|
||||
"go.mongodb.org/mongo-driver/bson"
|
||||
"go.mongodb.org/mongo-driver/mongo"
|
||||
"go.mongodb.org/mongo-driver/v2/bson"
|
||||
"go.mongodb.org/mongo-driver/v2/mongo"
|
||||
)
|
||||
|
||||
// FixTextSearchPipeline moves {$match:{$text:{$search}}} entries to the front of the pipeline (otherwise its an mongo error)
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package mongoext
|
||||
|
||||
import (
|
||||
"go.mongodb.org/mongo-driver/bson"
|
||||
"go.mongodb.org/mongo-driver/v2/bson"
|
||||
"reflect"
|
||||
"strings"
|
||||
)
|
||||
|
||||
+5
-39
@@ -1,51 +1,17 @@
|
||||
package mongoext
|
||||
|
||||
import (
|
||||
"git.blackforestbytes.com/BlackForestBytes/goext/exerr"
|
||||
"git.blackforestbytes.com/BlackForestBytes/goext/langext"
|
||||
"git.blackforestbytes.com/BlackForestBytes/goext/rfctime"
|
||||
"go.mongodb.org/mongo-driver/bson"
|
||||
"go.mongodb.org/mongo-driver/bson/bsoncodec"
|
||||
"go.mongodb.org/mongo-driver/bson/primitive"
|
||||
"reflect"
|
||||
|
||||
"go.mongodb.org/mongo-driver/v2/bson"
|
||||
)
|
||||
|
||||
func CreateGoExtBsonRegistry() *bsoncodec.Registry {
|
||||
func CreateGoExtBsonRegistry() *bson.Registry {
|
||||
reg := bson.NewRegistry()
|
||||
|
||||
reg.RegisterTypeDecoder(reflect.TypeFor[rfctime.RFC3339Time](), rfctime.RFC3339Time{})
|
||||
reg.RegisterTypeDecoder(reflect.TypeFor[*rfctime.RFC3339Time](), rfctime.RFC3339Time{})
|
||||
|
||||
reg.RegisterTypeDecoder(reflect.TypeFor[rfctime.RFC3339NanoTime](), rfctime.RFC3339NanoTime{})
|
||||
reg.RegisterTypeDecoder(reflect.TypeFor[*rfctime.RFC3339NanoTime](), rfctime.RFC3339NanoTime{})
|
||||
|
||||
reg.RegisterTypeDecoder(reflect.TypeFor[rfctime.UnixTime](), rfctime.UnixTime{})
|
||||
reg.RegisterTypeDecoder(reflect.TypeFor[*rfctime.UnixTime](), rfctime.UnixTime{})
|
||||
|
||||
reg.RegisterTypeDecoder(reflect.TypeFor[rfctime.UnixMilliTime](), rfctime.UnixMilliTime{})
|
||||
reg.RegisterTypeDecoder(reflect.TypeFor[*rfctime.UnixMilliTime](), rfctime.UnixMilliTime{})
|
||||
|
||||
reg.RegisterTypeDecoder(reflect.TypeFor[rfctime.UnixNanoTime](), rfctime.UnixNanoTime{})
|
||||
reg.RegisterTypeDecoder(reflect.TypeFor[*rfctime.UnixNanoTime](), rfctime.UnixNanoTime{})
|
||||
|
||||
reg.RegisterTypeDecoder(reflect.TypeFor[rfctime.Date](), rfctime.Date{})
|
||||
reg.RegisterTypeDecoder(reflect.TypeFor[*rfctime.Date](), rfctime.Date{})
|
||||
|
||||
reg.RegisterTypeDecoder(reflect.TypeFor[rfctime.SecondsF64](), rfctime.SecondsF64(0))
|
||||
reg.RegisterTypeDecoder(reflect.TypeOf(langext.Ptr(rfctime.SecondsF64(0))), rfctime.SecondsF64(0))
|
||||
|
||||
reg.RegisterTypeDecoder(reflect.TypeFor[exerr.ErrorCategory](), exerr.ErrorCategory{})
|
||||
reg.RegisterTypeDecoder(reflect.TypeOf(new(exerr.ErrorCategory{})), exerr.ErrorCategory{})
|
||||
|
||||
reg.RegisterTypeDecoder(reflect.TypeFor[exerr.ErrorSeverity](), exerr.ErrorSeverity{})
|
||||
reg.RegisterTypeDecoder(reflect.TypeOf(new(exerr.ErrorSeverity{})), exerr.ErrorSeverity{})
|
||||
|
||||
reg.RegisterTypeDecoder(reflect.TypeFor[exerr.ErrorType](), exerr.ErrorType{})
|
||||
reg.RegisterTypeDecoder(reflect.TypeOf(new(exerr.ErrorType{})), exerr.ErrorType{})
|
||||
|
||||
// otherwise we get []primitve.E when unmarshalling into any
|
||||
// otherwise we get []bson.E when unmarshalling into any
|
||||
// which will result in {'key': .., 'value': ...}[] json when json-marshalling
|
||||
reg.RegisterTypeMapEntry(bson.TypeEmbeddedDocument, reflect.TypeFor[primitive.M]())
|
||||
reg.RegisterTypeMapEntry(bson.TypeEmbeddedDocument, reflect.TypeFor[bson.M]())
|
||||
|
||||
return reg
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user