TMogoWire是一个Delphi的驱动,用来访问MogoDB数据库,它将映射Delphi的数据类型OleVariat。
示例代码:
TBSONDocumet = class(TIterfacedObject, IBSONDocumet, IPersistStream) Holds the data of a 'documet', the basic uit of data mogoDB works with. Implemets a IBSONDocumet iterface which allows it to be refereced by a OleVariat variable, which eables embeddig documets. Implemets the IPersistStream iterface to eable loadig from ad savig to BSON, the iteral biary storage specificatio used by mogoDB. fuctio BSON: IBSONDocumet; overload; fuctio BSON(x: array of OleVariat): IBSONDocumet; overload; Creates a BSON documet object ready for use. Optioally pass a sequece of key-value pairs, e.g.: BSON(['x',5,'y',7]); Use '[' ad ']' to created embedded documets, e.g.: BSON(['x','[','$gt',7,']']); Use VarArrayOf or 1-dimesioal variat arrays to add arrays, e.g.: BSON(['x',VarArrayOf([1,2,3])]);
评论