TMongoWire 介绍
TMongoWire 是一个 Delphi 的驱动用来访问 MongoDB 数据库,它将映射 Delphi 的数据类型 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])]);
TMongoWire 官网
https://github.com/stijnsanders/TMongoWire
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。