def by_field(field, value=nil, opts={})

      (value, opts = nil, value) if value.is_a?(Hash)

      if @context.storage.respond_to?(:by_field)
        return @context.storage.by_field('workitems', field, value, opts)
      end

      do_select(opts) do |hwi|
        hwi['fields'].keys.include?(field) &&
        (value.nil? || hwi['fields'][field] == value)
      end
    end
def by_field(field, value=nil, opts={})

      (value, opts = nil, value) if value.is_a?(Hash)

      if @context.storage.respond_to?(:by_field)
        return @context.storage.by_field('workitems', field, value, opts)
      end

      do_select(opts) do |hwi|
        hwi['fields'].keys.include?(field) &&
        (value.nil? || hwi['fields'][field] == value)
      end
    end
field : returns all the workitems with the given field name present.

 field and value : returns all the workitems with the given field name
 and the given value for that field.

 Warning : only some storages are optimized for such queries (like
 CouchStorage), the others will load all the workitems and then filter
 them.