The query : db.getCollection('homework').find({},{"field1.field2":1}) work well in robomongo.
When I use spring @query like this:
@Query(value = "{}", fields="{ ?0 : 1}")
public List findByDoRecordKey(String key); // key is "field1.field2"
It is not work well. And it works like:
db.getCollection('homework').find({},{"field1":1})
removed the field2.
The query : db.getCollection('homework').find({},{"field1.field2":1}) work well in robomongo. When I use spring @query like this: @Query(value = "{}", fields="{ ?0 : 1}") public List findByDoRecordKey(String key); // key is "field1.field2"
It is not work well. And it works like: db.getCollection('homework').find({},{"field1":1}) removed the field2.