person.name = "Oleg";
person.address = address;
template.save(person);
Query query = new BasicQuery("{'name' : 'Oleg'}");
List<MyPerson> result = template.find(query, MyPerson.class);
assertThat(result, hasSize(1));
assertThat(result.get(0), hasProperty("name", is("Oleg")));
query = new BasicQuery("{'address.state' : 'PA' }");
result = template.find(query, MyPerson.class);
assertThat(result, hasSize(1));
assertThat(result.get(0), hasProperty("name", is("Oleg")));
}