diff --git a/src/docbkx/reference/mongo-repositories.xml b/src/docbkx/reference/mongo-repositories.xml index 90532278c..ed8e9a53e 100644 --- a/src/docbkx/reference/mongo-repositories.xml +++ b/src/docbkx/reference/mongo-repositories.xml @@ -289,13 +289,14 @@ public class PersonRepositoryTests { public interface PersonRepository extends MongoRepository<Person, String> - @Query(value="{ 'firstname' : ?0 }", fields="firstname,lastname") + @Query(value="{ 'firstname' : ?0 }", fields="{ 'firstname': 1, 'lastname': 1}") List<Person> findByThePersonsFirstname(String firstname); } This will return only the firstname, lastname and Id properties of - the Person objects, for example age will be null. + the Person objects. The age property, a java.lang.Integer, will not be + set and its value will therefore be null.