I have a domain class say
class Content{
String content
Date dateCreated
Date lastUpdated
}
There are few content records in the database. I want to retrieve the latest two records. What is an efficient way to query two latest records in Grails? Thanks!
Isn't
Content.list(max: 2, sort: "dateCreated", order: "desc")
a possibility?