为了让前面规划的互联网+数据平台能有效对电子商务数据进行管理及实现大数据统计功能,必须在平台上再增加一个MongDB-Engine:数据平台用户通过传入一种Context来指示MongoDB-Engine运算。与前面JDBC-Engine和Cassandra-Engine通过文本式传递指令不同的是:MangoDB没有一套像SQL或CQL这样的文本式编程语言。但MangoDB基本上都是通过Bson类型的参数进行运算的,Bson是个java interface:
/** * An interface for types that are able to render themselves into a {@code BsonDocument}. * * @since 3.0 */ public interface Bson { /** * Render the filter into a BsonDocument. * * @param documentClass the document class in scope for the collection. This parameter may be ignored, but it may be used to alter * the structure of the returned {@code BsonDocument} based on some knowledge of the document class. * @param codecRegistry the codec registry. This parameter may be ignored, but it may be used to look up {@code Codec} instances for * the document class or any other related class. * @param <TDocument> the type of the document class * @return the BsonDocument */ <TDocument> BsonDocument toBsonDocument(Class<TDocument> documentClass, CodecRegistry codecRegistry); }