SearchParam class

When specifying each field in CollectionModelPath or DocumentModelPath, you can annotate the field to make it a search target.

If a field has this annotation, the document will be given a SearchableDocumentMixin.

The collection will also be given a SearchableCollectionMixin to allow searching from the collection using the search method.

CollectionModelPathDocumentModelPathの各フィールドを指定する際にフィールドにアノテーションを付けることでそのフィールドを検索対象にすることが可能です。

このアノテーションが付けられたフィールドがある場合、そのドキュメントにSearchableDocumentMixinが付与されます。

また、コレクションにはSearchableCollectionMixinが付与され、コレクションからsearchメソッドを使っての検索が可能となります。

@freezed
@formValue
@immutable
@CollectionModelPath("shop")
class ShopModel with _$ShopModel {
  const factory ShopModel({
    @searchParam @Default("") String name,
    @searchParam @Default("") String description,
  }) = _ShopModel;
  const ShopModel._();

  factory ShopModel.fromJson(Map<String, Object?> json) => _$ShopModelFromJson(json);

  static const document = _$ShopModelDocumentQuery();

  static const collection = _$ShopModelCollectionQuery();
}
Available Extensions

Constructors

SearchParam()
When specifying each field in CollectionModelPath or DocumentModelPath, you can annotate the field to make it a search target.
const

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited