FireDAC.Phys.MongoDBWrapper.TMongoExpression.Add

Aus RAD Studio API Documentation
Wechseln zu: Navigation, Suche

Delphi

function Add(const AKey: String; const AValue: String): TMongoExpression<T>; overload; inline;
function Add(const AKey: String; const AValue: Int32): TMongoExpression<T>; overload; inline;
function Add(const AKey: String; const AValue: Int64): TMongoExpression<T>; overload; inline;
function Add(const AKey: String; const AValue: Extended): TMongoExpression<T>; overload; inline;
function Add(const AKey: String; const AValue: Boolean): TMongoExpression<T>; overload; inline;
function Add(const AKey: String; const AValue: TDateTime): TMongoExpression<T>; overload; inline;
function Add(const AKey: String; const AValue: TBytes;
ABinaryType: TJsonBinaryType = TJsonBinaryType.Generic): TMongoExpression<T>; overload; inline;
function Add(const AKey: String; const AValue: TMongoOID): TMongoExpression<T>; overload; inline;
function Add(const AKey: String; const AValue: TJsonOid): TMongoExpression<T>; overload;
function Add(const AKey: string; const AValue: TJsonRegEx): TMongoExpression<T>; overload;
function Add(const AKey: string; const AValue: TJsonDBRef): TMongoExpression<T>; overload;
function Add(const AKey: string; const AValue: TJsonCodeWScope): TMongoExpression<T>; overload;
function Add(const AKey: String; const AValue: TVarRec): TMongoExpression<T>; overload; inline;
function Add(const AKey: String; const AValues: array of const): TMongoExpression<T>; overload;
function Add(const AKey: String; const AValue: Variant): TMongoExpression<T>; overload; inline;

C++

TMongoExpression__1<T>* __fastcall Add(const System::UnicodeString AKey, const System::UnicodeString AValue)/* overload */;
TMongoExpression__1<T>* __fastcall Add(const System::UnicodeString AKey, const int AValue)/* overload */;
TMongoExpression__1<T>* __fastcall Add(const System::UnicodeString AKey, const __int64 AValue)/* overload */;
TMongoExpression__1<T>* __fastcall Add(const System::UnicodeString AKey, const System::Extended AValue)/* overload */;
TMongoExpression__1<T>* __fastcall Add(const System::UnicodeString AKey, const bool AValue)/* overload */;
TMongoExpression__1<T>* __fastcall Add(const System::UnicodeString AKey, const System::TDateTime AValue)/* overload */;
TMongoExpression__1<T>* __fastcall Add(const System::UnicodeString AKey, const System::DynamicArray<System::Byte> AValue, System::Json::Types::TJsonBinaryType ABinaryType = (System::Json::Types::TJsonBinaryType)(0x0))/* overload */;
TMongoExpression__1<T>* __fastcall Add(const System::UnicodeString AKey, TMongoOID* const AValue)/* overload */;
TMongoExpression__1<T>* __fastcall Add(const System::UnicodeString AKey, const System::Json::Types::TJsonOid &AValue)/* overload */;
TMongoExpression__1<T>* __fastcall Add(const System::UnicodeString AKey, const System::Json::Types::TJsonRegEx &AValue)/* overload */;
TMongoExpression__1<T>* __fastcall Add(const System::UnicodeString AKey, const System::Json::Types::TJsonDBRef &AValue)/* overload */;
TMongoExpression__1<T>* __fastcall Add(const System::UnicodeString AKey, const System::Json::Types::TJsonCodeWScope &AValue)/* overload */;
TMongoExpression__1<T>* __fastcall Add(const System::UnicodeString AKey, const System::TVarRec &AValue)/* overload */;
TMongoExpression__1<T>* __fastcall Add(const System::UnicodeString AKey, const System::TVarRec *AValues, const int AValues_High)/* overload */;
TMongoExpression__1<T>* __fastcall Add(const System::UnicodeString AKey, const System::Variant &AValue)/* overload */;

Eigenschaften

Typ Sichtbarkeit Quelle Unit Übergeordnet
function public
FireDAC.Phys.MongoDBWrapper.pas
FireDAC.Phys.MongoDBWrapper.hpp
FireDAC.Phys.MongoDBWrapper TMongoExpression


Beschreibung

Fügt ein Feld/Wertepaar oder ein Array-Element mit einem bestimmten Typ hinzu und gibt eine Referenz auf diesen Ausdruck zurück.

Mit dieser Methode fügen Sie einem MongoDB-Ausdruck (EN) ein neues Feld/Wertepaar oder ein Array-Element hinzu.

Diese Methode ist überladen. Verwenden Sie die geeignete überladene Methode, um ein Feld/Wertepaar oder ein Array-Element mit einem bestimmten Typ hinzuzufügen.

Methoden-Header Beschreibung
 Add(const AKey: String; const AValue: String)

Fügt ein Feld/Wertepaar oder ein Array-Element mit dem Typ String hinzu.

Add(const AKey: String; const AValue: Int32)

Fügt ein Feld/Wertepaar oder ein Array-Element mit dem Typ Int32 hinzu.

Add(const AKey: String; const AValue: Int64)

Fügt ein Feld/Wertepaar oder ein Array-Element mit dem Typ Int64 hinzu.

Add(const AKey: String; const AValue: Extended)

Fügt ein Feld/Wertepaar oder ein Array-Element mit dem Typ Extended hinzu.

Add(const AKey: String; const AValue: Boolean)

Fügt ein Feld/Wertepaar oder ein Array-Element mit dem Typ Boolean hinzu.

Add(const AKey: String; const AValue: TDateTime)

Fügt ein Feld/Wertepaar oder ein Array-Element mit dem Typ TDateTime hinzu.

Add(const AKey: String; const AValue: TBytes;
      ABinaryType: TJsonBinaryType = TJsonBinaryType.Generic)

Fügt ein Feld/Wertepaar oder ein Array-Element mit dem Typ TBytes hinzu. Optional können Sie den Parameter ABinaryType angeben, der den binären BSON-Untertypen entspricht.

Add(const AKey: String; const AValue: TMongoOID)

Fügt ein Feld/Wertepaar oder ein Array-Element mit dem Typ TMongoOID hinzu.

Add(const AKey: String; const AValue: TJsonOid)

Fügt ein Feld/Wertepaar oder ein Array-Element mit dem Typ TJsonOid hinzu.

Add(const AKey: String; const AValue: TJsonRegEx)

Fügt ein Feld/Wertepaar oder ein Array-Element mit dem Typ TJsonRegEx hinzu.

Add(const AKey: String; const AValue: TJsonDBRef)

Fügt ein Feld/Wertepaar oder ein Array-Element mit dem Typ TJsonDBRef hinzu.

Add(const AKey: String; const AValue: TJsonCodeWScope)

Fügt ein Feld/Wertepaar oder ein Array-Element mit dem Typ TJsonCodeWScope hinzu.

Add(const AKey: String; const AValue: TVarRec)

Fügt ein Feld/Wertepaar oder ein Array-Element mit dem Typ TVarRec hinzu.

Add(const AKey: String; const AValues: array of const)

Fügt ein verschachteltes Array unter Verwendung des offenen Arrays AValues als Array-Elemente hinzu.

Das offene Array repräsentiert "analysiertes" JSON. Führen Sie Folgendes aus, um Elemente hinzuzufügen:

  • Um ein Feld/Wertepaar hinzuzufügen, geben Sie den Schlüsselnamen gefolgt von einem Wert an.
  • Um ein Array-Element hinzuzufügen, geben Sie einfach einen Wert an.
  • Um ein verschachteltes Objekt hinzuzufügen, müssen dessen Feld/Wertepaare in "{" und "}" eingeschlossen sein.
  • Um ein verschachteltes Array hinzuzufügen, müssen dessen Elemente in "[" und "]" eingeschlossen sein.

Zum Beispiel:

    • Add('coords', [123.45, 80.90]) -> "coords": [123.45, 80.90]
    • Add('grades', ['{', 'grade', 'A', 'score', 11, '}', '{', 'grade', 'B', 'score', 17, '}']) -> "grades": [{"grade": "A", "score": 11}, {"grade": "B", "score": 17}]
Add(const AKey: String; const AValue: Variant)

Fügt ein Feld/Wertepaar oder ein Array-Element mit einem durch den Datentyp Variant repräsentierten Typ hinzu.

HINWEIS: Beim Hinzufügen eines Arrays wird der AKey-Wert ignoriert. Aus Gründen der besseren Lesbarkeit können Sie einen Array-Index angeben.

Siehe auch