Skip to content

Instantly share code, notes, and snippets.

@prafful98
Created January 16, 2022 15:04
Embed
What would you like to do?
package com.example.api.repository;
import com.example.api.model.User;
import org.springframework.data.mongodb.repository.MongoRepository;
import org.springframework.data.mongodb.repository.Query;
public interface UserRepository extends MongoRepository<User, String> {
@Query(value = "{userName:'?0'}")
User findUserByUsername(String username);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment