CFMongoDB 介绍
CFMongoDB 是 MongoDB 的
ColdFusion 开发包,示例代码:
<cfscript> //save col = mongo.getDBCollection( 'my_collection' ); my_struct = { name = 'Orc #getTickCount()#' foo = 'bar' bar = 123 'tags'=[ 'cool', 'distributed', 'fast' ] }; col.save( my_struct ); //query result = col.query().startsWith('name','Orc').find(limit=20); writeOutput("Found #result.size()# of #result.totalCount()# Orcs"); //use the native mongo cursor. it is case sensitive! cursor = result.asCursor(); while( cursor.hasNext() ){ thisOrc = cursor.next(); writeOutput(" name = #thisOrc['name']# <br>"); } //use a ColdFusion array of structs. this is not case sensitive orcs = result.asArray(); for(orc in orcs){ writeOutput(" name = #orc.name# <br>"); } </cfscript>
CFMongoDB 官网
https://github.com/marcesher/cfmongodb/
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。