I have 2 columns String id, String Name and long age.
As we would have done in sql - select id FROM USERDETAILS Where Age > 5 would give me arrayList of primary keys that is "Id".
can anyone tell me how to do the same for mongo db using morphia.
I tried with query.retrieveFields(true,"id").get();
but it returns a USERDETAILS Model in return , i need only array of ids. how can i do this please help