FireDAC.Phys.MongoDBWrapper.IMongoCursor

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

Delphi

IMongoCursor = interface(IInterface)

C++

__interface  INTERFACE_UUID("{7D8AF712-3FA8-459B-BF9B-4EC7E55B7359}") IMongoCursor  : public System::IInterface

プロパティ

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


説明

結果セットのカーソル インターフェイスを表します。

IMongoCursor インターフェイスは、以下で実装されています。

  • "fluent" 形式コマンド ビルダ。このビルダではコマンドが結果セットを返します。そのため、ビルダをインターフェイスにキャストすると、コマンドが実行され、カーソルが提供されます。
  • TMongoCursor.TDefault クラス。デフォルトのインターフェイス実装です。

明確になるよう以下に例を挙げます。

Delphi の場合:
 var
  FCon: TMongoConnection;
  oCrs:  IMongoCursor;
  Memo1: TMemo;
// ...
// Find, retrieve and show all documents from the database 'test' (collection 'restaurants')
   oCrs := FCon['test']['restaurants'].Find();
   while oCrs.Next do
      Memo1.Text := Memo1.Text + sLineBreak + oCrs.Doc.AsJSON;
C++Builder の場合:
TMongoConnection *FCon;
di_IMongoCursor  oCrs;
Memo1* TMemo;
// ...
// Find, retrieve and show all documents from the database 'test' (collection 'restaurants')
	oCrs =  interface_cast<IMongoCursor>(MongoCon->Databases["test"]->Collections["restaurants"]->Find());
	while (oCrs->Next()) {
          Memo1->Text = Memo1->Text +  sLineBreak + oCrs->Doc->AsJSON;
	}

関連項目