(Quick Reference)

count

Purpose

Returns the number of documents stored in the database. Optionally a query can be passed to count by query.

Examples

// count all documents of that type
println Book.count()
// count by query
println Book.count([author:'Dan Brown'])

Description

The basic syntax for the method is:

Book.count()
Book.count( Map query )

Parameters: