Skip to content

Commit 456dba4

Browse files
committed
fix; collectionInstrumentId in lunaticmodels was not persisted on insert
1 parent 70aba98 commit 456dba4

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/main/java/fr/insee/genesis/infrastructure/adapter/LunaticModelMongoAdapter.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,9 @@ public void save(LunaticModelModel lunaticModelModel) {
3434
);
3535
mongoTemplate.update(LunaticModelDocument.class)
3636
.matching(criteria)
37-
.apply(new Update().set("lunaticModel", lunaticModelModel.lunaticModel()))
37+
.apply(new Update()
38+
.set("lunaticModel", lunaticModelModel.lunaticModel())
39+
.setOnInsert("collectionInstrumentId", lunaticModelModel.collectionInstrumentId()))
3840
.upsert();
3941
}
4042

0 commit comments

Comments
 (0)