Skip to content

Spring Lemon Commons MongoDB Guide

Sanjay Patel edited this page Jan 12, 2019 · 2 revisions

spring-lemon-commons-mongo includes spring-lemon-commons-reactive and adds Spring Data MongoDB Reactive to it. It comes with a couple of features, discussed below.

AbstractDocument

AbstractDocument is a base document class, with support for auditing, optimistic locking, and permission evaluation. When you need any of these features in an entity, inherit that from this one.

How to ensure that some data being updated isn't stale

LecmUtils.ensureCorrectVersion can be used for ensuring some data isn't stale, particularly after an edit request received from front-end. Check out how it's used when editing a user, in LemonReactiveService.updateUser.