I'm playing with Spring Data Mongo Query and wondering about the field property parameters. Here is the example that I got from the documentation:
public interface PersonRepository extends MongoRepository<Person, String>
@Query(value="{ 'firstname' : ?0 }", fields="{ 'firstname' : 1, 'lastname' : 1}")
List<Person> findByThePersonsFirstname(String firstname);
}
The question is: What is the meaning of 1
in { 'firstname' : 1, 'lastname' : 1}
?