From f0b30ec39e021a24745b7d5ef3b052aebac29132 Mon Sep 17 00:00:00 2001 From: Mark Pollack Date: Mon, 25 Apr 2011 14:01:00 -0400 Subject: [PATCH] DATADOC-99 - Reference documentation shows invalid field spec for @Query usage with repositories --- src/docbkx/reference/mongo-repositories.xml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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.