field method

Query field(
  1. Map<String, bool> projection
)

Implementation

Query field(Map<String, bool> projection) {
  Map<String, int> newProjection = {};
  projection.forEach((key, value) {
    newProjection[key] = value ? 1 : 0;
  });

  var newOptions = QueryOption(
    limit: _queryOptions!.limit,
    offset: _queryOptions!.offset,
    projection: newProjection,
  );

  return Query(
    core: _core,
    coll: _coll,
    fieldFilters: _fieldFilters,
    fieldOrders: _fieldOrders,
    queryOptions: newOptions,
  );
}