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.
You can name the query itself by specifying name.
Modelを定義するためのクエリクラス。
クエリ対象となるpathを与えて、ドキュメントの読み込み等を行います。
adapterを指定することでデータの読取・保存の際の挙動を変えることができます。adapterは何も指定されない場合ModelAdapter.primaryが使用されます。
accessQueryを指定した場合、ModelAdapterでのエンドポイント等を指定できます。
validationQueriesを指定した場合、利用するモデルのデータバリデーションを指定できます。
コレクションに対してはCollectionModelQueryを使用してください。
nameを指定するとクエリ自体に名前をつけることができます。
- Inheritance
-
- Object
- ModelQuery
- DocumentModelQuery
- Annotations
Constructors
-
DocumentModelQuery(String path, {ModelAdapter? adapter, ModelAccessQuery? accessQuery, List<
ModelValidationQuery> ? validationQueries, bool useTestModelAdapter = true, String? name}) -
Query class for defining Model.
const
-
DocumentModelQuery.fromJson(Map<
String, Object?> json) -
Create a DocumentModelQuery from a Map.
factory
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
- name → String?
-
Name for the query.
finalinherited
- 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
trueto 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, String? name}) → DocumentModelQuery -
Copy DocumentModelQuery with
path,adapter,accessQueryandvalidationQueries. -
hasMatchAsList(
List< DynamicMap> data) → bool -
Runs hasMatchAsMap recursively in List and returns
trueif one of the matches is found.inherited -
hasMatchAsMap(
DynamicMap? data) → bool -
Pass filters through
dataand returntrueif all conditions are met.inherited -
hasMatchAsObject(
Object? data) → bool -
Ignores ModelQueryFilter.key and returns
trueif 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< sorted, DynamicMap data) → FutureOr<String, DynamicMap> >int?> -
The position where
dataenters is retrieved by searching fromsortedaccording to the sort setting of filters.inherited -
sort(
List< MapEntry< data) → Future<String, DynamicMap> >List< MapEntry< >String, DynamicMap> > -
Sort
dataaccording to the settings in filters.inherited -
toJson(
) → Map< String, Object?> -
Convert ModelQuery to Map.
inherited
-
toString(
) → String -
A string representation of this object.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
override