All Downloads are FREE. Search and download functionalities are using the official Maven repository.

ftl.data.mongo.method.$$MongoRepositoryUpdateEntityMethodBodyTemplateftl Maven / Gradle / Ivy

There is a newer version: 0.11
Show newest version
<#include "../mongo-lib.javaftl">
<#-- -------------------------------------------------------------------------------------------------------- -->
final Document filter = new Document("_id", ${ENTITY_CONVERTER}.getId(${ENTITY}));
<#-- -------------------------------------------------------------------------------------------------------- -->
final Document update = new Document("$set", ${ENTITY_CONVERTER}.toDB(${ENTITY}, false));
<#-- -------------------------------------------------------------------------------------------------------- -->
final Publisher result = collection
        .updateMany(
                filter,
                update,
                new UpdateOptions().upsert(${UPSERT?c})
        );
<@returnUpdateResult />




© 2015 - 2025 Weber Informatics LLC | Privacy Policy