From 76f67587e75fb5f2f95e82dd232baa5784d7449d Mon Sep 17 00:00:00 2001 From: "francesco.mangiacrapa" Date: Wed, 19 Apr 2023 11:07:34 +0200 Subject: [PATCH] changed set updatedDocument --- .../geoportal/service/engine/mongo/ProfiledMongoManager.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/geoportal-service/src/main/java/org/gcube/application/geoportal/service/engine/mongo/ProfiledMongoManager.java b/geoportal-service/src/main/java/org/gcube/application/geoportal/service/engine/mongo/ProfiledMongoManager.java index 1bd8a05..90695c5 100644 --- a/geoportal-service/src/main/java/org/gcube/application/geoportal/service/engine/mongo/ProfiledMongoManager.java +++ b/geoportal-service/src/main/java/org/gcube/application/geoportal/service/engine/mongo/ProfiledMongoManager.java @@ -190,7 +190,9 @@ public class ProfiledMongoManager extends MongoManager implements MongoManagerI< Document filter = new Document(mongoIDFieldName(), asId(proj.getId())).append(Project.LOCK + "." + Lock.ID, oldLock.getId()); - Document setUpdatedDocument = new Document("$set", new Document(Project.THE_DOCUMENT, proj.getTheDocument())); + String documentValueAsJson = proj.getTheDocument().toJson(); + String updatedDocumentAsJson = new Document(Project.THE_DOCUMENT,documentValueAsJson).toJson(); + Document setUpdatedDocument = new Document("$set", updatedDocumentAsJson); log.info("Filter document is {} ", filter.toJson()); log.info("$set is {} ", setUpdatedDocument);