DocumentModelQuery constructor

const DocumentModelQuery(
  1. String path, {
  2. ModelAdapter? adapter,
  3. ModelAccessQuery? accessQuery,
  4. List<ModelValidationQuery>? validationQueries,
  5. bool useTestModelAdapter = true,
})

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を使用してください。

Implementation

const DocumentModelQuery(
  super.path, {
  super.adapter,
  super.accessQuery,
  super.validationQueries,
  super.useTestModelAdapter = true,
});