From 55e2fc2fb2ea498aad76cf301b6a5cb81afcfdf3 Mon Sep 17 00:00:00 2001 From: Levichev Dmitry Date: Wed, 19 Jan 2022 20:59:20 +0300 Subject: [PATCH] Fix MongoDbPersistence method in GetListByFilter --- CHANGELOG.md | 4 ++++ component.json | 2 +- docker/Dockerfile.build | 7 ++----- docker/Dockerfile.test | 9 +++------ persistence/MongoDbPersistence.go | 2 ++ 5 files changed, 12 insertions(+), 12 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 60f96dd..e389dba 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Pip.Services Logo
MongoDB components for Golang Changelog +## 1.1.1 (2022-01-19) +### Bug Fixes +- Fix MongoDbPersistence method in GetListByFilter. + ## 1.1.0 (2021-04-03) ### Breaking changes diff --git a/component.json b/component.json index 2cdb94a..945b07f 100644 --- a/component.json +++ b/component.json @@ -1,6 +1,6 @@ { "name": "pip-services3-mongodb-go", "registry": "github.com/pip-services3-go", - "version": "1.1.0", + "version": "1.1.1", "build": 0 } diff --git a/docker/Dockerfile.build b/docker/Dockerfile.build index 93f3f31..b92b471 100644 --- a/docker/Dockerfile.build +++ b/docker/Dockerfile.build @@ -10,13 +10,10 @@ ENV GO111MODULE=on \ WORKDIR /app # Copy the package files -COPY go.mod ./ +COPY . . # Install all go_modules -RUN go mod download - -# Copy the package files -COPY . . +RUN go mod tidy # Build the project RUN go build -o /go/bin/run . diff --git a/docker/Dockerfile.test b/docker/Dockerfile.test index 222b7ad..c361370 100644 --- a/docker/Dockerfile.test +++ b/docker/Dockerfile.test @@ -9,14 +9,11 @@ ENV GO111MODULE=on \ # Set a working directory WORKDIR /app -# Copy the package files -COPY go.mod ./ - -# Install all go_modules -RUN go mod download - # Copy the entire project COPY . . +# Install all go_modules +RUN go mod tidy + # Specify the command from running tests CMD go test -v ./test/... \ No newline at end of file diff --git a/persistence/MongoDbPersistence.go b/persistence/MongoDbPersistence.go index 1dccaee..16cffbe 100644 --- a/persistence/MongoDbPersistence.go +++ b/persistence/MongoDbPersistence.go @@ -571,6 +571,8 @@ func (c *MongoDbPersistence) GetListByFilter(correlationId string, filter interf return nil, ferr } + items = make([]interface{}, 0) + for cursor.Next(c.Connection.Ctx) { docPointer := c.NewObjectByPrototype() curErr := cursor.Decode(docPointer.Interface())