couchdb_basic 0.0.1.beta → 0.0.2.beta
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/couchdb_basic.rb +12 -2
- metadata +1 -1
data/lib/couchdb_basic.rb
CHANGED
@@ -82,9 +82,19 @@ class Couchdb
|
|
82
82
|
_get(url)[:rows]
|
83
83
|
end
|
84
84
|
|
85
|
-
def get_all()
|
85
|
+
def get_all(args={})
|
86
|
+
url = "/_all_docs?include_docs=true"
|
87
|
+
if args.has_key?( :skip )
|
88
|
+
skip = MultiJson.dump( args[:skip] )
|
89
|
+
url << "&skip=#{skip}"
|
90
|
+
end
|
91
|
+
if args.has_key?( :limit )
|
92
|
+
limit = MultiJson.dump( args[:limit] )
|
93
|
+
url << "&limit=#{limit}"
|
94
|
+
end
|
86
95
|
docs = []
|
87
|
-
_get(
|
96
|
+
_get(url)[:rows].each{ | row | docs << row[:doc ] }
|
88
97
|
docs
|
89
98
|
end
|
99
|
+
|
90
100
|
end
|