(Quick Reference)

find

Purpose

Finds domain class instances for the specified query and returns the first result

Examples

// 1 book from Dan Brown staring from 5th book ordered by release date
Book.find([author:'Dan Brown'],[offset:5,sort:'releaseDate'])

Description

Book.find( Map query )
Book.find( Map query, Map queryParams )

Parameters:

  • query - A filter for querying
  • queryParams - A Map containing parameters max, offset, sort and validate (to turn off morphia mapping validation)