RDDB是一个Ruby开发的面向文档的数据库系统,其灵感来自CouchDB。
示例代码:
#Firstcreateandatabaseobjectdatabase=Rddb::Database.new#Putsomedocumentsintoitdatabase<<{:name=>'John',:income=>35000}database<<{:name=>'Bob',:income=>40000}database<<{:name=>'Jim',:income=>37000}#Createaviewthatwillreturnthenamesdatabase.create_view('names')do|document,args|document.nameend#Theresultofqueryingwillreturnanarrayofnamesassert_equal['John','Bob','Jim'],database.query('names')
评论