DocumentModelQuery class

Query class for defining Model.

The path to be queried is given and the document is loaded, etc.

By specifying adapter, you can change the behavior when reading and saving data. If no adapter is specified, ModelAdapter.primary is used.

If accessQuery is specified, you can specify endpoints, etc. in ModelAdapter.

If validationQueries is specified, you can specify the data validation of the model to be used.

Use CollectionModelQuery for collections.

Modelを定義するためのクエリクラス。

クエリ対象となるpathを与えて、ドキュメントの読み込み等を行います。

adapterを指定することでデータの読取・保存の際の挙動を変えることができます。adapterは何も指定されない場合ModelAdapter.primaryが使用されます。

accessQueryを指定した場合、ModelAdapterでのエンドポイント等を指定できます。

validationQueriesを指定した場合、利用するモデルのデータバリデーションを指定できます。

コレクションに対してはCollectionModelQueryを使用してください。

Inheritance
Annotations

Constructors

DocumentModelQuery(String path, {ModelAdapter? adapter, ModelAccessQuery? accessQuery, List<ModelValidationQuery>? validationQueries, bool useTestModelAdapter = true})
Query class for defining Model.
const

Properties

accessQuery ModelAccessQuery?
Stores information for connecting to the server.
finalinherited
adapter ModelAdapter
An adapter for defining the process of reading and saving data. If adapter is not specified, ModelAdapter.primary is used.
no setterinherited
filters List<ModelQueryFilter>
Filter definition for the model.
finalinherited
hashCode int
The hash code for this object.
no setteroverride
path String
Path definition for the model.
finalinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
useTestModelAdapter bool
Set to true to use the model adapter for testing when testing.
finalinherited
validationQueries List<ModelValidationQuery>?
Query for data validation.
finalinherited

Methods

copyWith({String? path, ModelAdapter? adapter, ModelAccessQuery? accessQuery, List<ModelValidationQuery>? validationQueries, bool? useTestModelAdapter}) DocumentModelQuery
Copy DocumentModelQuery with path, adapter, accessQuery and validationQueries.
hasMatchAsList(List<DynamicMap> data) bool
Runs hasMatchAsMap recursively in List and returns true if one of the matches is found.
inherited
hasMatchAsMap(DynamicMap? data) bool
Pass filters through data and return true if all conditions are met.
inherited
hasMatchAsObject(Object? data) bool
Ignores ModelQueryFilter.key and returns true if it is within all of the conditions in filters.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
seekIndex(List<MapEntry<String, DynamicMap>> sorted, DynamicMap data) int?
The position where data enters is retrieved by searching from sorted according to the sort setting of filters.
inherited
sort(List<MapEntry<String, DynamicMap>> data) List<MapEntry<String, DynamicMap>>
Sort data according to the settings in filters.
inherited
toString() String
A string representation of this object.
override

Operators

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