From e97404527df0eff85f22e13b1f012a08c8bdf857 Mon Sep 17 00:00:00 2001 From: jiangzhi Date: Sat, 21 Aug 2021 12:52:06 +0800 Subject: [PATCH 1/3] mongo official driver to 1.7.1 --- go.mod | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/go.mod b/go.mod index 4583ff2..4512f63 100644 --- a/go.mod +++ b/go.mod @@ -5,5 +5,5 @@ go 1.16 require ( github.com/go-playground/validator/v10 v10.4.1 github.com/stretchr/testify v1.6.1 - go.mongodb.org/mongo-driver v1.5.1 + go.mongodb.org/mongo-driver v1.7.1 ) From 5b4a15fbfc00436556b8c614c5fcc2fc463c4f81 Mon Sep 17 00:00:00 2001 From: jiangzhi Date: Sat, 21 Aug 2021 14:06:07 +0800 Subject: [PATCH 2/3] mongo official driver to 1.7.1 --- go.sum | 2 ++ query_test.go | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/go.sum b/go.sum index aa82b6b..e2d96c9 100644 --- a/go.sum +++ b/go.sum @@ -103,6 +103,8 @@ github.com/youmark/pkcs8 v0.0.0-20181117223130-1be2e3e5546d h1:splanxYIlg+5LfHAM github.com/youmark/pkcs8 v0.0.0-20181117223130-1be2e3e5546d/go.mod h1:rHwXgn7JulP+udvsHwJoVG1YGAP6VLg4y9I5dyZdqmA= go.mongodb.org/mongo-driver v1.5.1 h1:9nOVLGDfOaZ9R0tBumx/BcuqkbFpyTCU2r/Po7A2azI= go.mongodb.org/mongo-driver v1.5.1/go.mod h1:gRXCHX4Jo7J0IJ1oDQyUxF7jfy19UfxniMS4xxMmUqw= +go.mongodb.org/mongo-driver v1.7.1 h1:jwqTeEM3x6L9xDXrCxN0Hbg7vdGfPBOTIkr0+/LYZDA= +go.mongodb.org/mongo-driver v1.7.1/go.mod h1:Q4oFMbo1+MSNqICAdYMlC/zSTrwCogR4R8NzkI+yfU8= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190422162423-af44ce270edf/go.mod h1:WFFai1msRO1wXaEeE5yQxYXgSfI8pQAWXbQop6sCtWE= diff --git a/query_test.go b/query_test.go index 580ed55..edd0fe5 100644 --- a/query_test.go +++ b/query_test.go @@ -438,7 +438,7 @@ func TestQuery_Distinct(t *testing.T) { var res6 []int32 err = cli.Find(context.Background(), filter2).Distinct("", &res6) - ast.NoError(err) + ast.Error(err) // (Location40352) FieldPath cannot be constructed with empty string ast.Equal(0, len(res6)) var res7 []int32 From 17def202522dee78422e7a4e391972579a6b679d Mon Sep 17 00:00:00 2001 From: jiangzhi Date: Sun, 22 Aug 2021 20:06:28 +0800 Subject: [PATCH 3/3] mongo official driver to 1.7.1 --- query_test.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/query_test.go b/query_test.go index edd0fe5..16e7357 100644 --- a/query_test.go +++ b/query_test.go @@ -435,11 +435,11 @@ func TestQuery_Distinct(t *testing.T) { err = cli.Find(context.Background(), filter2).Distinct("age", &res5) ast.EqualError(err, ErrQueryResultTypeInconsistent.Error()) - var res6 []int32 - - err = cli.Find(context.Background(), filter2).Distinct("", &res6) - ast.Error(err) // (Location40352) FieldPath cannot be constructed with empty string - ast.Equal(0, len(res6)) + // different behavior with different version of mongod, v4.4.0 return err and v4.0.19 return nil + //var res6 []int32 + //err = cli.Find(context.Background(), filter2).Distinct("", &res6) + //ast.Error(err) // (Location40352) FieldPath cannot be constructed with empty string + //ast.Equal(0, len(res6)) var res7 []int32 filter3 := 1