FireDAC.Phys.MongoDBWrapper.TMongoConnection.Collections

From Appmethod Libraries
Jump to: navigation, search

Object Pascal

property Collections[const ADBName, AColName: String]: TMongoCollection read GetCollectionsProp;

C++

__property TMongoCollection* Collections[const System::UnicodeString ADBName][const System::UnicodeString AColName] = {read=GetCollectionsProp};

Properties

Type Visibility Source Unit Parent
property public
FireDAC.Phys.MongoDBWrapper.pas
FireDAC.Phys.MongoDBWrapper.hpp
FireDAC.Phys.MongoDBWrapper TMongoConnection

Description

Collection with the specified name located in the specified database of the MongoDB server.

The connection object owns this shared collection object. Use GetCollection to obtain a private collection object that you must destroy.

Every time that you read a collection from Collections, you obtain the same shared object, updated to point to the specified collection. For example:

Object Pascal:

A := MyConnection.Collections['test', 'a'];
B := MyConnection.Collections['test', 'b'];
// A.Name = 'b'

C++:

TMongoCollection* A = MyConnection->Collections["test"]["a"];
TMongoCollection* B = MyConnection->Collections["test"]["b"];
// A->Name == "b"

See Also