TMongoObject = class abstract(TObject)
class PASCALIMPLEMENTATION TMongoObject : public System::TObject
A base class for all MongoDB API wrapping classes.
TMongoObject is an abstract class that is responsible for the life cycle of a MongoDB API handle. This class provides references to client libraries, the environment and error objects.
The MongoDB API handle may be assigned to this object:
- by derived classes, which directly assign the handle to the private variable FHandle;
- by the Create constructor: in this case, this object will own the handle;
- by assigning a handle to the Handle property: in this case, the caller owns the handle.
When this object owns the handle, the MongoDB API handle will be automatically destroyed in the following cases:
- when you call the object destructor;
- by assigning any appropriate value to the Handle property, when this object owns the handle.
Otherwise, the handle must be destroyed manually.