field static method

Map<String, Object?> field(
  1. String name,
  2. Object? query
)

Constructs a query for a specific field.

The query parameter defines the condition for the field.

Example:

var query = DQ.field('name', DQ.like('John')); // { 'name': { '\$regex': 'John', '\$options': 'i' } }

Implementation

static Map<String, Object?> field(String name, Object? query) {
  return {
    name: query,
  };
}