FireDAC.Phys.MongoDBWrapper.TMongoPipeline

提供: RAD Studio API Documentation
移動先: 案内検索

System.TInterfacedObjectSystem.TObjectTMongoPipeline

Delphi

TMongoPipeline = class(TInterfacedObject, IMongoCursor)

C++

class PASCALIMPLEMENTATION TMongoPipeline : public System::TInterfacedObject

プロパティ

種類 可視性 ソース ユニット
class public
FireDAC.Phys.MongoDBWrapper.pas
FireDAC.Phys.MongoDBWrapper.hpp
FireDAC.Phys.MongoDBWrapper FireDAC.Phys.MongoDBWrapper


説明

フルーエント スタイルの MongoDB パイプライン ビルダを表します。

TMongoPipeline オブジェクトは、次のような状況で使用することができます。

次のメソッドを使用して、パイプラインのステージを定義することができます:

また、パイプラインのオプションを定義することもできます。

次のコード スニペットは、コレクションを集約パイプラインに渡す方法を示しており、その後、各区画に対するドキュメントの数をカウントします。出力リストは、count フィールドでソートされます。

メモ: 詳細は、MongoDB Restaurants サンプル プロジェクトを参照してください。

Delphi の場合:
 var
  oCrs: IMongoCursor;
  oCrs := FCon['test']['restaurants'].Aggregate()
    .Group
      .Add('_id', '$borough')
      .BeginObject('count')
        .Add('$sum', 1)
      .EndObject
    .&End
    .Sort('{ count: 1 }').&End;
C++Builder の場合:
di_IMongoCursor  oCrs = interface_cast<IMongoCursor>(MongoCon->Databases["test"]->Collections["restaurants"]->Aggregate())
->Group()
      ->Add("_id", "$borough")
      ->BeginObject("count")
        ->Add("$sum", 1)
      ->EndObject()
     ->End()
    ->Sort("{ count: 1 }")->End();

関連項目