Mongo - Ignore property from being persisted

Solution 1:

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

Solution 2:

In case you are looking for the actual package like I was, this one will work:

import org.springframework.data.annotation.Transient;

Which is from the Spring framework API documentation.

But this one, which is a JPA annotation, will not work for MongoDB:

import javax.persistence.Transient;

Which is part of the Java Persistence API.