Search code examples
javamongodbspring-dataspring-data-document

Mongo - Ignore property from being persisted


I have a standard POJO that has a set of properties in it. The POJO has been annotated as a @Document, so as to be persisted in MongoDB as a Document.

How (annotation??) can I ignore/avoid one of the properties in the POJO from being persisted?


Solution

  • The @Transient annotation it is. See http://static.springsource.org/spring-data/data-document/docs/current/reference/html/#mapping-usage-annotations