RDDB面向文档的数据库
RDDB 是一个 Ruby 开发的面向文档的数据库系统,其灵感来自 CouchDB。
示例代码:
# First create an database object database = Rddb::Database.new # Put some documents into it database << {:name => 'John', :income => 35000} database << {:name => 'Bob', :income => 40000} database << {:name => 'Jim', :income => 37000} # Create a view that will return the names database.create_view('names') do |document, args| document.name end # The result of querying will return an array of names assert_equal ['John','Bob','Jim'], database.query('names')
评论