From 7d71a507a75b1ca0dffe7ec7f86d74c3940caff9 Mon Sep 17 00:00:00 2001 From: Levichev Dmitry Date: Mon, 5 Apr 2021 09:26:15 +0300 Subject: [PATCH] Update dependencies --- go.mod | 2 +- persistence/IdentifiableMongoDbPersistence.go | 2 +- persistence/MongoDbPersistence.go | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index c988a59..8119b52 100644 --- a/go.mod +++ b/go.mod @@ -5,7 +5,7 @@ go 1.16 require ( github.com/pip-services3-go/pip-services3-commons-go v1.1.0 github.com/pip-services3-go/pip-services3-components-go v1.1.0 - github.com/pip-services3-go/pip-services3-data-go v1.0.7 + github.com/pip-services3-go/pip-services3-data-go v1.1.0 github.com/stretchr/testify v1.7.0 go.mongodb.org/mongo-driver v1.5.1 ) diff --git a/persistence/IdentifiableMongoDbPersistence.go b/persistence/IdentifiableMongoDbPersistence.go index 9c3334c..8f29775 100644 --- a/persistence/IdentifiableMongoDbPersistence.go +++ b/persistence/IdentifiableMongoDbPersistence.go @@ -272,7 +272,7 @@ func (c *IdentifiableMongoDbPersistence) Update(correlationId string, item inter if item == nil { //|| item.id == nil return nil, nil } - newItem := cmpersist.CloneObject(item) + newItem := cmpersist.CloneObject(item, c.Prototype) id := cmpersist.GetObjectId(newItem) filter := bson.M{"_id": id} update := bson.D{{"$set", newItem}} diff --git a/persistence/MongoDbPersistence.go b/persistence/MongoDbPersistence.go index 800f75f..1dccaee 100644 --- a/persistence/MongoDbPersistence.go +++ b/persistence/MongoDbPersistence.go @@ -641,7 +641,7 @@ func (c *MongoDbPersistence) Create(correlationId string, item interface{}) (res return nil, nil } var newItem interface{} - newItem = cmpersist.CloneObject(item) + newItem = cmpersist.CloneObject(item, c.Prototype) newItem = c.Overrides.ConvertFromPublic(newItem) insRes, insErr := c.Collection.InsertOne(c.Connection.Ctx, newItem) newItem = c.Overrides.ConvertToPublic(newItem)