spring-projects/spring-data-mongodb — pull request #147 by christophstrobl (2014-03-12 13:38:28+00:00)
Title: DATAMONGO-566 - Add support for derived 'deleteBy' and 'removeBy'.

Using keywords `remove` or `delete` in derived query, or setting @Query(delete=true) removes documents matching the query.

If the return type can be assigned to `Number` the total number of affected documents is returned.

In case the return type is collection like the query is executed against the store in first place. All documents included in the resulting collection are deleted in a subsequent call.

Additionally `findAllAndRemove` methods have been added to `MongoTemplate`.