TMongoWireMongoDB 的 Delphi 驅(qū)動
TMongoWire 是一個 Delphi 的驅(qū)動,用來訪問 MongoDB 數(shù)據(jù)庫,它將映射 Delphi 的數(shù)據(jù)類型 OleVariant。
示例代碼:
TBSONDocument = class(TInterfacedObject, IBSONDocument, IPersistStream) Holds the data of a 'document', the basic unit of data mongoDB works with. Implements an IBSONDocument interface which allows it to be referenced by an OleVariant variable, which enables embedding documents. Implements the IPersistStream interface to enable loading from and saving to BSON, the internal binary storage specification used by mongoDB. function BSON: IBSONDocument; overload; function BSON(x: array of OleVariant): IBSONDocument; overload; Creates a BSON document object ready for use. Optionally pass a sequence of key-value pairs, e.g.: BSON(['x',5,'y',7]); Use '[' and ']' to created embedded documents, e.g.: BSON(['x','[','$gt',7,']']); Use VarArrayOf or 1-dimensional variant arrays to add arrays, e.g.: BSON(['x',VarArrayOf([1,2,3])]);
評論
圖片
表情
