Skip to content

Instantly share code, notes, and snippets.

@arthurportas
Created January 28, 2017 19:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save arthurportas/39d0a91f069621c031d879ff6d35e109 to your computer and use it in GitHub Desktop.
Save arthurportas/39d0a91f069621c031d879ff6d35e109 to your computer and use it in GitHub Desktop.
UserRepository.java
package com.arthurportas.mongodb.example.repository;
import com.arthurportas.mongodb.example.domain.User;
import org.springframework.data.mongodb.repository.MongoRepository;
import org.springframework.stereotype.Repository;
import java.time.ZonedDateTime;
import java.util.Date;
import java.util.List;
/**
* Created by arthurportas on 21/01/2017.
*/
@Repository
public interface UserRepository extends MongoRepository<User, String>{
List<User> findByLastUpdated(Date date);
List<User> findByLastUpdatedLessThan(Date date);
void deleteByLastUpdatedLessThan(Date date);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment