leanback 0.4.0 → 0.4.1
Sign up to get free protection for your applications and to get access to all the features.
- data/Changelog.rdoc +6 -0
- data/README.md +1 -1
- data/VERSION +1 -1
- data/documentation/static/2011/11/20/i-moved-leanback-documentation/index.html +180 -0
- data/documentation/static/2011/11/20/index.html +146 -0
- data/documentation/static/2011/11/index.html +146 -0
- data/documentation/static/2011/index.html +146 -0
- data/documentation/static/2013/06/02/index.html +146 -0
- data/documentation/static/2013/06/02/released-leanback-v0-3-4/index.html +180 -0
- data/documentation/static/2013/06/09/index.html +146 -0
- data/documentation/static/2013/06/09/released-leanback-v0-4-0/index.html +179 -0
- data/documentation/static/2013/06/index.html +158 -0
- data/documentation/static/2013/index.html +158 -0
- data/documentation/static/author/admin/index.html +175 -0
- data/documentation/static/basic-couchdb-operations/index.html +259 -0
- data/documentation/static/category/uncategorized/index.html +170 -0
- data/documentation/static/couchdb-configuration/index.html +189 -0
- data/documentation/static/couchdb-security/index.html +218 -0
- data/documentation/static/count-by-multiple-documents/index.html +221 -0
- data/documentation/static/count-documents-by-key/index.html +177 -0
- data/documentation/static/css/2c-l-fixed.css +1 -0
- data/documentation/static/css/2c-l-fixed.dev.css +62 -0
- data/documentation/static/css/2c-r-fixed.css +1 -0
- data/documentation/static/css/2c-r-fixed.dev.css +60 -0
- data/documentation/static/css/3c-c-fixed.css +1 -0
- data/documentation/static/css/3c-c-fixed.dev.css +84 -0
- data/documentation/static/css/3c-l-fixed.css +1 -0
- data/documentation/static/css/3c-l-fixed.dev.css +61 -0
- data/documentation/static/css/3c-r-fixed.css +1 -0
- data/documentation/static/css/3c-r-fixed.dev.css +62 -0
- data/documentation/static/css/holy-grail-fluid.css +5 -0
- data/documentation/static/css/plugins.css +5 -0
- data/documentation/static/css/print.css +5 -0
- data/documentation/static/css/screen.css +1 -0
- data/documentation/static/design-documents-and-permanent-views/index.html +454 -0
- data/documentation/static/error-handling/index.html +157 -0
- data/documentation/static/find-document-by-multiple-keys/index.html +269 -0
- data/documentation/static/find-documents-by-key/index.html +243 -0
- data/documentation/static/index.html +161 -0
- data/documentation/static/leanback/index.html +130 -0
- data/documentation/static/leanback/installation/index.html +119 -0
- data/documentation/static/setting-the-bind_address-port/index.html +151 -0
- data/documentation/static/style.css +16 -0
- data/leanback.gemspec +44 -2
- data/lib/leanback.rb +518 -535
- data/spec/no_admin_party/cloudant_spec.rb +365 -0
- metadata +45 -3
@@ -0,0 +1,158 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html lang="en-US">
|
3
|
+
<head>
|
4
|
+
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
5
|
+
<title>Archive for 2013</title>
|
6
|
+
|
7
|
+
<link rel="stylesheet" href="http://www.whisperservers.com/leanback/wp-content/themes/hybrid/style.css" type="text/css" media="all" />
|
8
|
+
<link rel="profile" href="http://gmpg.org/xfn/11" />
|
9
|
+
<link rel="pingback" href="http://www.whisperservers.com/leanback/xmlrpc.php" />
|
10
|
+
|
11
|
+
<meta name="generator" content="WordPress 3.5.1 - really-static 0.5" />
|
12
|
+
<meta name="template" content="Hybrid 1.0" />
|
13
|
+
<meta name="robots" content="index,follow" />
|
14
|
+
<meta name="copyright" content="Copyright (c) 2013" />
|
15
|
+
<link rel="alternate" type="application/rss+xml" title="Leanback » Feed" href="http://www.whisperservers.com/leanback/wp-content/plugins/really-static/static/feed/" />
|
16
|
+
|
17
|
+
<script type='text/javascript' src='http://www.whisperservers.com/leanback/wp-includes/js/jquery/jquery.js?ver=1.8.3'></script>
|
18
|
+
|
19
|
+
<link rel="stylesheet" href="http://www.whisperservers.com/leanback/wp-content/plugins/wp-syntax/wp-syntax.css" type="text/css" media="screen" />
|
20
|
+
|
21
|
+
</head>
|
22
|
+
|
23
|
+
<body class="wordpress ltr en_US parent-theme y2013 m06 d09 h16 sunday logged-out archive date year primary-active secondary-inactive subsidiary-inactive">
|
24
|
+
|
25
|
+
|
26
|
+
<div id="body-container">
|
27
|
+
|
28
|
+
|
29
|
+
<div id="header-container">
|
30
|
+
|
31
|
+
<div id="header">
|
32
|
+
|
33
|
+
<div id="site-title"><a href="http://www.whisperservers.com/leanback/wp-content/plugins/really-static/static/" title="Leanback" rel="home"><span>Leanback</span></a></div>
|
34
|
+
<div id="site-description"><span>Simple Ruby interface to CouchDB</span></div>
|
35
|
+
|
36
|
+
</div><!-- #header -->
|
37
|
+
|
38
|
+
</div><!-- #header-container -->
|
39
|
+
|
40
|
+
|
41
|
+
<div id="container">
|
42
|
+
|
43
|
+
|
44
|
+
<div id="content" class="hfeed content">
|
45
|
+
|
46
|
+
<div class="breadcrumb breadcrumbs"><div class="breadcrumb-trail"><span class="trail-before"><span class="breadcrumb-title">Browse:</span></span> <a href="http://www.whisperservers.com/leanback/wp-content/plugins/really-static/static/" title="Leanback" rel="home" class="trail-begin">Home</a> <span class="sep">/</span> <span class="trail-end">2013</span></div></div>
|
47
|
+
|
48
|
+
|
49
|
+
<div class="loop-meta archive-info date-info">
|
50
|
+
<h1 class="loop-title archive-title date-title">Archives by date</h1>
|
51
|
+
|
52
|
+
<div class="loop-description archive-description date-description">
|
53
|
+
<p>
|
54
|
+
You are browsing the site archives by date. </p>
|
55
|
+
</div><!-- .loop-description -->
|
56
|
+
|
57
|
+
</div><!-- .loop-meta -->
|
58
|
+
|
59
|
+
|
60
|
+
|
61
|
+
<div id="post-177" class="hentry post publish post-1 odd author-admin category-uncategorized">
|
62
|
+
|
63
|
+
|
64
|
+
<h2 class="entry-title"><a href="http://www.whisperservers.com/leanback/wp-content/plugins/really-static/static/2013/06/09/released-leanback-v0-4-0/" title="Released leanback v0.4.0" rel="bookmark">Released leanback v0.4.0</a></h2><p class="byline">By <span class="author vcard"><a class="url fn n" href="http://www.whisperservers.com/leanback/wp-content/plugins/really-static/static/author/admin/" title="admin">admin</a></span> on <abbr class="published" title="Sunday, June 9th, 2013, 3:43 pm">June 9, 2013</abbr> </p>
|
65
|
+
<div class="entry-summary">
|
66
|
+
<p>Just released leanback v0.4.0. See the changelog for new changes.</p>
|
67
|
+
</div><!-- .entry-summary -->
|
68
|
+
|
69
|
+
<p class="entry-meta"><span class="category"><span class="before">Posted in </span><a href="http://www.whisperservers.com/leanback/wp-content/plugins/really-static/static/category/uncategorized/" rel="tag">Uncategorized</a></span> | <a class="comments-link" href="http://www.whisperservers.com/leanback/wp-content/plugins/really-static/static/2013/06/09/released-leanback-v0-4-0/#respond" title="Comment on Released leanback v0.4.0">Leave a response</a></p>
|
70
|
+
</div><!-- .hentry -->
|
71
|
+
|
72
|
+
|
73
|
+
<div id="post-159" class="hentry post publish post-2 even alt author-admin category-uncategorized">
|
74
|
+
|
75
|
+
|
76
|
+
<h2 class="entry-title"><a href="http://www.whisperservers.com/leanback/wp-content/plugins/really-static/static/2013/06/02/released-leanback-v0-3-4/" title="Released leanback v0.3.4" rel="bookmark">Released leanback v0.3.4</a></h2><p class="byline">By <span class="author vcard"><a class="url fn n" href="http://www.whisperservers.com/leanback/wp-content/plugins/really-static/static/author/admin/" title="admin">admin</a></span> on <abbr class="published" title="Sunday, June 2nd, 2013, 6:24 pm">June 2, 2013</abbr> </p>
|
77
|
+
<div class="entry-summary">
|
78
|
+
<p>Just released leanback v0.3.4. See the changelog for new changes.</p>
|
79
|
+
</div><!-- .entry-summary -->
|
80
|
+
|
81
|
+
<p class="entry-meta"><span class="category"><span class="before">Posted in </span><a href="http://www.whisperservers.com/leanback/wp-content/plugins/really-static/static/category/uncategorized/" rel="tag">Uncategorized</a></span> | <a class="comments-link" href="http://www.whisperservers.com/leanback/wp-content/plugins/really-static/static/2013/06/02/released-leanback-v0-3-4/#respond" title="Comment on Released leanback v0.3.4">Leave a response</a></p>
|
82
|
+
</div><!-- .hentry -->
|
83
|
+
|
84
|
+
<script type="text/javascript">
|
85
|
+
// <![CDATA[
|
86
|
+
var disqus_shortname = 'obi-akubue';
|
87
|
+
var disqus_domain = 'disqus.com';
|
88
|
+
(function () {
|
89
|
+
var nodes = document.getElementsByTagName('span');
|
90
|
+
for (var i = 0, url; i < nodes.length; i++) {
|
91
|
+
if (nodes[i].className.indexOf('dsq-postid') != -1) {
|
92
|
+
nodes[i].parentNode.setAttribute('data-disqus-identifier', nodes[i].getAttribute('rel'));
|
93
|
+
url = nodes[i].parentNode.href.split('#', 1);
|
94
|
+
if (url.length == 1) { url = url[0]; }
|
95
|
+
else { url = url[1]; }
|
96
|
+
nodes[i].parentNode.href = url + '#disqus_thread';
|
97
|
+
}
|
98
|
+
}
|
99
|
+
var s = document.createElement('script'); s.async = true;
|
100
|
+
s.type = 'text/javascript';
|
101
|
+
s.src = 'http://' + disqus_domain + '/forums/' + disqus_shortname + '/count.js';
|
102
|
+
(document.getElementsByTagName('HEAD')[0] || document.getElementsByTagName('BODY')[0]).appendChild(s);
|
103
|
+
}());
|
104
|
+
//]]>
|
105
|
+
</script>
|
106
|
+
|
107
|
+
|
108
|
+
|
109
|
+
|
110
|
+
</div><!-- .content .hfeed -->
|
111
|
+
|
112
|
+
|
113
|
+
<div id="primary" class="sidebar aside">
|
114
|
+
|
115
|
+
|
116
|
+
<div id="hybrid-nav-menu-3" class="widget nav-menu widget-nav-menu"><div class="widget-wrap widget-inside"><h3 class="widget-title">Leanback</h3><div class="menu-sidebar-container"><ul id="menu-sidebar" class="nav-menu"><li id="menu-item-13" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-13"><a href="http://www.whisperservers.com/leanback/wp-content/plugins/really-static/static/leanback/">Leanback</a><ul class="sub-menu"><li id="menu-item-14" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-14"><a href="http://www.whisperservers.com/leanback/wp-content/plugins/really-static/static/leanback/installation/">Install</a></li><li id="menu-item-15" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-15"><a href="http://www.whisperservers.com/leanback/wp-content/plugins/really-static/static/basic-couchdb-operations/">Basic CouchDB Operations</a></li><li id="menu-item-41" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-41"><a href="http://www.whisperservers.com/leanback/wp-content/plugins/really-static/static/find-documents-by-key/">Find documents by key</a></li><li id="menu-item-167" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-167"><a href="http://www.whisperservers.com/leanback/wp-content/plugins/really-static/static/find-document-by-multiple-keys/">Find document by multiple Keys</a></li><li id="menu-item-140" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-140"><a href="http://www.whisperservers.com/leanback/wp-content/plugins/really-static/static/count-documents-by-key/">Count documents by key</a></li><li id="menu-item-175" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-175"><a href="http://www.whisperservers.com/leanback/wp-content/plugins/really-static/static/count-by-multiple-documents/">Count documents by multiple keys</a></li><li id="menu-item-45" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-45"><a href="http://www.whisperservers.com/leanback/wp-content/plugins/really-static/static/design-documents-and-permanent-views/">Working with CouchDB views</a></li><li id="menu-item-67" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-67"><a href="http://www.whisperservers.com/leanback/wp-content/plugins/really-static/static/error-handling/">Error handling</a></li><li id="menu-item-96" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-96"><a href="http://www.whisperservers.com/leanback/wp-content/plugins/really-static/static/couchdb-configuration/">CouchDB Configuration</a></li><li id="menu-item-102" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-102"><a href="http://www.whisperservers.com/leanback/wp-content/plugins/really-static/static/couchdb-security/">CouchDB Security</a></li><li id="menu-item-105" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-105"><a href="http://www.whisperservers.com/leanback/wp-content/plugins/really-static/static/setting-the-bind_address-port/">CouchDB Bind_Address & Port</a></li></ul></li><li id="menu-item-142" class="menu-item menu-item-type-custom menu-item-object-custom menu-item-142"><a href="https://github.com/obi-a/leanback/blob/master/Changelog.rdoc">Changes</a></li><li id="menu-item-78" class="menu-item menu-item-type-custom menu-item-object-custom menu-item-78"><a href="https://github.com/obi-a/leanback">Source Code</a></li></ul></div></div></div>
|
117
|
+
|
118
|
+
</div><!-- #primary .aside -->
|
119
|
+
|
120
|
+
|
121
|
+
</div><!-- #container -->
|
122
|
+
|
123
|
+
<div id="footer-container">
|
124
|
+
|
125
|
+
|
126
|
+
<div id="footer">
|
127
|
+
|
128
|
+
<div class="footer-insert"><p class="copyright">Copyright © 2013 <a href="http://obi-akubue.org">obi-akubue.org</a>.</p></div>
|
129
|
+
</div><!-- #footer -->
|
130
|
+
|
131
|
+
|
132
|
+
</div><!-- #footer-container -->
|
133
|
+
|
134
|
+
</div><!-- #body-container -->
|
135
|
+
|
136
|
+
|
137
|
+
<script type="text/javascript">
|
138
|
+
|
139
|
+
var _gaq = _gaq || [];
|
140
|
+
_gaq.push(['_setAccount', 'UA-20190925-6']);
|
141
|
+
_gaq.push(['_trackPageview']);
|
142
|
+
|
143
|
+
(function() {
|
144
|
+
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
|
145
|
+
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
|
146
|
+
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(ga);
|
147
|
+
})();
|
148
|
+
</script>
|
149
|
+
|
150
|
+
<a style='color:transparent;position:absolute;left:-99999px;z-index:-99999' href='http://www.wpdownloadmanager.com/' title='Premium Wordpress Plugin download manager'>Premium Wordpress Plugin</a>
|
151
|
+
<script type='text/javascript' src='http://www.whisperservers.com/leanback/wp-content/themes/hybrid/library/js/drop-downs.js?ver=20110705'></script>
|
152
|
+
|
153
|
+
</body>
|
154
|
+
</html>
|
155
|
+
<!-- Dynamic page generated in 0.392 seconds. -->
|
156
|
+
<!-- Cached page generated by WP-Super-Cache on 2013-06-09 16:29:25 -->
|
157
|
+
|
158
|
+
<!-- super cache -->
|
@@ -0,0 +1,175 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html lang="en-US">
|
3
|
+
<head>
|
4
|
+
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
5
|
+
<title>admin</title>
|
6
|
+
|
7
|
+
<link rel="stylesheet" href="http://www.whisperservers.com/leanback/wp-content/themes/hybrid/style.css" type="text/css" media="all" />
|
8
|
+
<link rel="profile" href="http://gmpg.org/xfn/11" />
|
9
|
+
<link rel="pingback" href="http://www.whisperservers.com/leanback/xmlrpc.php" />
|
10
|
+
|
11
|
+
<meta name="generator" content="WordPress 3.5.1 - really-static 0.5" />
|
12
|
+
<meta name="template" content="Hybrid 1.0" />
|
13
|
+
<meta name="robots" content="index,follow" />
|
14
|
+
<meta name="author" content="admin" />
|
15
|
+
<meta name="copyright" content="Copyright (c) 2013" />
|
16
|
+
<link rel="alternate" type="application/rss+xml" title="Leanback » Feed" href="http://www.whisperservers.com/leanback/wp-content/plugins/really-static/static/feed/" />
|
17
|
+
|
18
|
+
<link rel="alternate" type="application/rss+xml" title="Leanback » Posts by admin Feed" href="http://www.whisperservers.com/leanback/wp-content/plugins/really-static/static/author/admin/feed/" />
|
19
|
+
<script type='text/javascript' src='http://www.whisperservers.com/leanback/wp-includes/js/jquery/jquery.js?ver=1.8.3'></script>
|
20
|
+
|
21
|
+
<link rel="stylesheet" href="http://www.whisperservers.com/leanback/wp-content/plugins/wp-syntax/wp-syntax.css" type="text/css" media="screen" />
|
22
|
+
|
23
|
+
</head>
|
24
|
+
|
25
|
+
<body class="wordpress ltr en_US parent-theme y2013 m06 d09 h16 sunday logged-out archive user user-admin primary-active secondary-inactive subsidiary-inactive">
|
26
|
+
|
27
|
+
|
28
|
+
<div id="body-container">
|
29
|
+
|
30
|
+
|
31
|
+
<div id="header-container">
|
32
|
+
|
33
|
+
<div id="header">
|
34
|
+
|
35
|
+
<div id="site-title"><a href="http://www.whisperservers.com/leanback/wp-content/plugins/really-static/static/" title="Leanback" rel="home"><span>Leanback</span></a></div>
|
36
|
+
<div id="site-description"><span>Simple Ruby interface to CouchDB</span></div>
|
37
|
+
|
38
|
+
</div><!-- #header -->
|
39
|
+
|
40
|
+
</div><!-- #header-container -->
|
41
|
+
|
42
|
+
|
43
|
+
<div id="container">
|
44
|
+
|
45
|
+
|
46
|
+
<div id="content" class="hfeed content">
|
47
|
+
|
48
|
+
<div class="breadcrumb breadcrumbs"><div class="breadcrumb-trail"><span class="trail-before"><span class="breadcrumb-title">Browse:</span></span> <a href="http://www.whisperservers.com/leanback/wp-content/plugins/really-static/static/" title="Leanback" rel="home" class="trail-begin">Home</a> <span class="sep">/</span> <span class="trail-end">admin</span></div></div>
|
49
|
+
|
50
|
+
|
51
|
+
|
52
|
+
<div id="hcard-admin" class="loop-meta vcard archive-info user-info user-profile author-info author-profile">
|
53
|
+
|
54
|
+
<h1 class="loop-title fn n archive-title user-title author-title">admin</h1>
|
55
|
+
|
56
|
+
<div class="loop-description archive-description user-description author-description">
|
57
|
+
<img alt='admin' src='http://0.gravatar.com/avatar/adeace0c02f8ececd3fa89d417bef521?s=100&d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D100&r=G' class='avatar avatar-100 photo' height='100' width='100' />
|
58
|
+
<p class="user-bio author-bio">
|
59
|
+
</p><!-- .user-bio -->
|
60
|
+
</div><!-- .loop-description -->
|
61
|
+
|
62
|
+
</div><!-- .loop-meta -->
|
63
|
+
|
64
|
+
|
65
|
+
|
66
|
+
<div id="post-177" class="hentry post publish post-1 odd author-admin category-uncategorized">
|
67
|
+
|
68
|
+
|
69
|
+
<h2 class="entry-title"><a href="http://www.whisperservers.com/leanback/wp-content/plugins/really-static/static/2013/06/09/released-leanback-v0-4-0/" title="Released leanback v0.4.0" rel="bookmark">Released leanback v0.4.0</a></h2><p class="byline">By <span class="author vcard"><a class="url fn n" href="http://www.whisperservers.com/leanback/wp-content/plugins/really-static/static/author/admin/" title="admin">admin</a></span> on <abbr class="published" title="Sunday, June 9th, 2013, 3:43 pm">June 9, 2013</abbr> </p>
|
70
|
+
<div class="entry-summary">
|
71
|
+
<p>Just released leanback v0.4.0. See the changelog for new changes.</p>
|
72
|
+
</div><!-- .entry-summary -->
|
73
|
+
|
74
|
+
<p class="entry-meta"><span class="category"><span class="before">Posted in </span><a href="http://www.whisperservers.com/leanback/wp-content/plugins/really-static/static/category/uncategorized/" rel="tag">Uncategorized</a></span> | <a class="comments-link" href="http://www.whisperservers.com/leanback/wp-content/plugins/really-static/static/2013/06/09/released-leanback-v0-4-0/#respond" title="Comment on Released leanback v0.4.0">Leave a response</a></p>
|
75
|
+
</div><!-- .hentry -->
|
76
|
+
|
77
|
+
|
78
|
+
<div id="post-159" class="hentry post publish post-2 even alt author-admin category-uncategorized">
|
79
|
+
|
80
|
+
|
81
|
+
<h2 class="entry-title"><a href="http://www.whisperservers.com/leanback/wp-content/plugins/really-static/static/2013/06/02/released-leanback-v0-3-4/" title="Released leanback v0.3.4" rel="bookmark">Released leanback v0.3.4</a></h2><p class="byline">By <span class="author vcard"><a class="url fn n" href="http://www.whisperservers.com/leanback/wp-content/plugins/really-static/static/author/admin/" title="admin">admin</a></span> on <abbr class="published" title="Sunday, June 2nd, 2013, 6:24 pm">June 2, 2013</abbr> </p>
|
82
|
+
<div class="entry-summary">
|
83
|
+
<p>Just released leanback v0.3.4. See the changelog for new changes.</p>
|
84
|
+
</div><!-- .entry-summary -->
|
85
|
+
|
86
|
+
<p class="entry-meta"><span class="category"><span class="before">Posted in </span><a href="http://www.whisperservers.com/leanback/wp-content/plugins/really-static/static/category/uncategorized/" rel="tag">Uncategorized</a></span> | <a class="comments-link" href="http://www.whisperservers.com/leanback/wp-content/plugins/really-static/static/2013/06/02/released-leanback-v0-3-4/#respond" title="Comment on Released leanback v0.3.4">Leave a response</a></p>
|
87
|
+
</div><!-- .hentry -->
|
88
|
+
|
89
|
+
|
90
|
+
<div id="post-113" class="hentry post publish post-3 odd author-admin category-uncategorized">
|
91
|
+
|
92
|
+
|
93
|
+
<h2 class="entry-title"><a href="http://www.whisperservers.com/leanback/wp-content/plugins/really-static/static/2011/11/20/i-moved-leanback-documentation/" title="Welcome to the new site" rel="bookmark">Welcome to the new site</a></h2><p class="byline">By <span class="author vcard"><a class="url fn n" href="http://www.whisperservers.com/leanback/wp-content/plugins/really-static/static/author/admin/" title="admin">admin</a></span> on <abbr class="published" title="Sunday, November 20th, 2011, 10:48 pm">November 20, 2011</abbr> </p>
|
94
|
+
<div class="entry-summary">
|
95
|
+
<p>This is the new location for Leanback RubyGem’s documentation. I moved it here, to support the release of v0.3.0. A README file format wouldn’t be sufficient anymore. So I decided to move the documentation over here, to make it more accessible.</p>
|
96
|
+
</div><!-- .entry-summary -->
|
97
|
+
|
98
|
+
<p class="entry-meta"><span class="category"><span class="before">Posted in </span><a href="http://www.whisperservers.com/leanback/wp-content/plugins/really-static/static/category/uncategorized/" rel="tag">Uncategorized</a></span> | <a class="comments-link" href="http://www.whisperservers.com/leanback/wp-content/plugins/really-static/static/2011/11/20/i-moved-leanback-documentation/#respond" title="Comment on Welcome to the new site">Leave a response</a></p>
|
99
|
+
</div><!-- .hentry -->
|
100
|
+
|
101
|
+
<script type="text/javascript">
|
102
|
+
// <![CDATA[
|
103
|
+
var disqus_shortname = 'obi-akubue';
|
104
|
+
var disqus_domain = 'disqus.com';
|
105
|
+
(function () {
|
106
|
+
var nodes = document.getElementsByTagName('span');
|
107
|
+
for (var i = 0, url; i < nodes.length; i++) {
|
108
|
+
if (nodes[i].className.indexOf('dsq-postid') != -1) {
|
109
|
+
nodes[i].parentNode.setAttribute('data-disqus-identifier', nodes[i].getAttribute('rel'));
|
110
|
+
url = nodes[i].parentNode.href.split('#', 1);
|
111
|
+
if (url.length == 1) { url = url[0]; }
|
112
|
+
else { url = url[1]; }
|
113
|
+
nodes[i].parentNode.href = url + '#disqus_thread';
|
114
|
+
}
|
115
|
+
}
|
116
|
+
var s = document.createElement('script'); s.async = true;
|
117
|
+
s.type = 'text/javascript';
|
118
|
+
s.src = 'http://' + disqus_domain + '/forums/' + disqus_shortname + '/count.js';
|
119
|
+
(document.getElementsByTagName('HEAD')[0] || document.getElementsByTagName('BODY')[0]).appendChild(s);
|
120
|
+
}());
|
121
|
+
//]]>
|
122
|
+
</script>
|
123
|
+
|
124
|
+
|
125
|
+
|
126
|
+
|
127
|
+
</div><!-- .content .hfeed -->
|
128
|
+
|
129
|
+
|
130
|
+
<div id="primary" class="sidebar aside">
|
131
|
+
|
132
|
+
|
133
|
+
<div id="hybrid-nav-menu-3" class="widget nav-menu widget-nav-menu"><div class="widget-wrap widget-inside"><h3 class="widget-title">Leanback</h3><div class="menu-sidebar-container"><ul id="menu-sidebar" class="nav-menu"><li id="menu-item-13" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-13"><a href="http://www.whisperservers.com/leanback/wp-content/plugins/really-static/static/leanback/">Leanback</a><ul class="sub-menu"><li id="menu-item-14" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-14"><a href="http://www.whisperservers.com/leanback/wp-content/plugins/really-static/static/leanback/installation/">Install</a></li><li id="menu-item-15" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-15"><a href="http://www.whisperservers.com/leanback/wp-content/plugins/really-static/static/basic-couchdb-operations/">Basic CouchDB Operations</a></li><li id="menu-item-41" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-41"><a href="http://www.whisperservers.com/leanback/wp-content/plugins/really-static/static/find-documents-by-key/">Find documents by key</a></li><li id="menu-item-167" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-167"><a href="http://www.whisperservers.com/leanback/wp-content/plugins/really-static/static/find-document-by-multiple-keys/">Find document by multiple Keys</a></li><li id="menu-item-140" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-140"><a href="http://www.whisperservers.com/leanback/wp-content/plugins/really-static/static/count-documents-by-key/">Count documents by key</a></li><li id="menu-item-175" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-175"><a href="http://www.whisperservers.com/leanback/wp-content/plugins/really-static/static/count-by-multiple-documents/">Count documents by multiple keys</a></li><li id="menu-item-45" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-45"><a href="http://www.whisperservers.com/leanback/wp-content/plugins/really-static/static/design-documents-and-permanent-views/">Working with CouchDB views</a></li><li id="menu-item-67" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-67"><a href="http://www.whisperservers.com/leanback/wp-content/plugins/really-static/static/error-handling/">Error handling</a></li><li id="menu-item-96" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-96"><a href="http://www.whisperservers.com/leanback/wp-content/plugins/really-static/static/couchdb-configuration/">CouchDB Configuration</a></li><li id="menu-item-102" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-102"><a href="http://www.whisperservers.com/leanback/wp-content/plugins/really-static/static/couchdb-security/">CouchDB Security</a></li><li id="menu-item-105" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-105"><a href="http://www.whisperservers.com/leanback/wp-content/plugins/really-static/static/setting-the-bind_address-port/">CouchDB Bind_Address & Port</a></li></ul></li><li id="menu-item-142" class="menu-item menu-item-type-custom menu-item-object-custom menu-item-142"><a href="https://github.com/obi-a/leanback/blob/master/Changelog.rdoc">Changes</a></li><li id="menu-item-78" class="menu-item menu-item-type-custom menu-item-object-custom menu-item-78"><a href="https://github.com/obi-a/leanback">Source Code</a></li></ul></div></div></div>
|
134
|
+
|
135
|
+
</div><!-- #primary .aside -->
|
136
|
+
|
137
|
+
|
138
|
+
</div><!-- #container -->
|
139
|
+
|
140
|
+
<div id="footer-container">
|
141
|
+
|
142
|
+
|
143
|
+
<div id="footer">
|
144
|
+
|
145
|
+
<div class="footer-insert"><p class="copyright">Copyright © 2013 <a href="http://obi-akubue.org">obi-akubue.org</a>.</p></div>
|
146
|
+
</div><!-- #footer -->
|
147
|
+
|
148
|
+
|
149
|
+
</div><!-- #footer-container -->
|
150
|
+
|
151
|
+
</div><!-- #body-container -->
|
152
|
+
|
153
|
+
|
154
|
+
<script type="text/javascript">
|
155
|
+
|
156
|
+
var _gaq = _gaq || [];
|
157
|
+
_gaq.push(['_setAccount', 'UA-20190925-6']);
|
158
|
+
_gaq.push(['_trackPageview']);
|
159
|
+
|
160
|
+
(function() {
|
161
|
+
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
|
162
|
+
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
|
163
|
+
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(ga);
|
164
|
+
})();
|
165
|
+
</script>
|
166
|
+
|
167
|
+
<a style='color:transparent;position:absolute;left:-99999px;z-index:-99999' href='http://www.wpdownloadmanager.com/' title='Premium Wordpress Plugin download manager'>Premium Wordpress Plugin</a>
|
168
|
+
<script type='text/javascript' src='http://www.whisperservers.com/leanback/wp-content/themes/hybrid/library/js/drop-downs.js?ver=20110705'></script>
|
169
|
+
|
170
|
+
</body>
|
171
|
+
</html>
|
172
|
+
<!-- Dynamic page generated in 2.193 seconds. -->
|
173
|
+
<!-- Cached page generated by WP-Super-Cache on 2013-06-09 16:26:55 -->
|
174
|
+
|
175
|
+
<!-- super cache -->
|
@@ -0,0 +1,259 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html lang="en-US">
|
3
|
+
<head>
|
4
|
+
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
5
|
+
<title>Basic CouchDB Operations</title>
|
6
|
+
|
7
|
+
<link rel="stylesheet" href="http://www.whisperservers.com/leanback/wp-content/themes/hybrid/style.css" type="text/css" media="all" />
|
8
|
+
<link rel="profile" href="http://gmpg.org/xfn/11" />
|
9
|
+
<link rel="pingback" href="http://www.whisperservers.com/leanback/xmlrpc.php" />
|
10
|
+
|
11
|
+
<meta name="generator" content="WordPress 3.5.1 - really-static 0.5" />
|
12
|
+
<meta name="template" content="Hybrid 1.0" />
|
13
|
+
<meta name="robots" content="index,follow" />
|
14
|
+
<meta name="author" content="admin" />
|
15
|
+
<meta name="copyright" content="Copyright (c) November 2011" />
|
16
|
+
<meta name="revised" content="Sunday, November 20th, 2011, 11:17 pm" />
|
17
|
+
<link rel="alternate" type="application/rss+xml" title="Leanback » Feed" href="http://www.whisperservers.com/leanback/wp-content/plugins/really-static/static/feed/" />
|
18
|
+
|
19
|
+
<script type='text/javascript' src='http://www.whisperservers.com/leanback/wp-includes/js/jquery/jquery.js?ver=1.8.3'></script>
|
20
|
+
<link rel='prev' title='Install' href='http://www.whisperservers.com/leanback/wp-content/plugins/really-static/static/leanback/installation/' />
|
21
|
+
<link rel='next' title='Find documents by key' href='http://www.whisperservers.com/leanback/wp-content/plugins/really-static/static/find-documents-by-key/' />
|
22
|
+
<link rel='canonical' href='http://www.whisperservers.com/leanback/wp-content/plugins/really-static/static/basic-couchdb-operations/' />
|
23
|
+
|
24
|
+
<link rel="stylesheet" href="http://www.whisperservers.com/leanback/wp-content/plugins/wp-syntax/wp-syntax.css" type="text/css" media="screen" />
|
25
|
+
|
26
|
+
</head>
|
27
|
+
|
28
|
+
<body class="wordpress ltr en_US parent-theme y2013 m06 d09 h16 sunday logged-out singular singular-page singular-page-11 page-template-default page-11 primary-active secondary-inactive subsidiary-inactive">
|
29
|
+
|
30
|
+
|
31
|
+
<div id="body-container">
|
32
|
+
|
33
|
+
|
34
|
+
<div id="header-container">
|
35
|
+
|
36
|
+
<div id="header">
|
37
|
+
|
38
|
+
<div id="site-title"><a href="http://www.whisperservers.com/leanback/wp-content/plugins/really-static/static/" title="Leanback" rel="home"><span>Leanback</span></a></div>
|
39
|
+
<div id="site-description"><span>Simple Ruby interface to CouchDB</span></div>
|
40
|
+
|
41
|
+
</div><!-- #header -->
|
42
|
+
|
43
|
+
</div><!-- #header-container -->
|
44
|
+
|
45
|
+
|
46
|
+
<div id="container">
|
47
|
+
|
48
|
+
|
49
|
+
<div id="content" class="hfeed content">
|
50
|
+
|
51
|
+
<div class="breadcrumb breadcrumbs"><div class="breadcrumb-trail"><span class="trail-before"><span class="breadcrumb-title">Browse:</span></span> <a href="http://www.whisperservers.com/leanback/wp-content/plugins/really-static/static/" title="Leanback" rel="home" class="trail-begin">Home</a> <span class="sep">/</span> <span class="trail-end">Basic CouchDB Operations</span></div></div>
|
52
|
+
|
53
|
+
<div id="post-11" class="hentry page publish post-1 odd author-admin">
|
54
|
+
|
55
|
+
<h1 class="page-title entry-title"><a href="http://www.whisperservers.com/leanback/wp-content/plugins/really-static/static/basic-couchdb-operations/" title="Basic CouchDB Operations" rel="bookmark">Basic CouchDB Operations</a></h1>
|
56
|
+
<div class="entry-content">
|
57
|
+
<p>Require the leanback Gem</p>
|
58
|
+
|
59
|
+
<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;"><span style="color:#CC0066; font-weight:bold;">require</span> <span style="color:#996600;">'leanback'</span></pre></div></div>
|
60
|
+
|
61
|
+
<p>Default bind address and port is localhost and 5984 respectively.<br />
|
62
|
+
To login to CouchDB as an admin or non-admin user</p>
|
63
|
+
|
64
|
+
<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;">hash = Couchdb.<span style="color:#9900CC;">login</span><span style="color:#006600; font-weight:bold;">(</span>username = <span style="color:#996600;">'samson'</span>,password =<span style="color:#996600;">'sam123'</span><span style="color:#006600; font-weight:bold;">)</span>
|
65
|
+
auth_session = hash<span style="color:#006600; font-weight:bold;">[</span><span style="color:#996600;">"AuthSession"</span><span style="color:#006600; font-weight:bold;">]</span></pre></div></div>
|
66
|
+
|
67
|
+
<p>Leanback uses CouchDB’s cookie authentication.</p>
|
68
|
+
|
69
|
+
<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;"> Couchdb.<span style="color:#9900CC;">login</span><span style="color:#006600; font-weight:bold;">(</span>username = <span style="color:#996600;">'samson'</span>,password =<span style="color:#996600;">'sam123'</span><span style="color:#006600; font-weight:bold;">)</span>
|
70
|
+
<span style="color:#008000; font-style:italic;">#=>{"AuthSession"=>"b2JpOjRFQzgyQ0U0OlA54YsdHNo8altYRIkLVVeyvwah",</span>
|
71
|
+
<span style="color:#008000; font-style:italic;"># "Version"=>"1", "Path"=>"%2F"}</span></pre></div></div>
|
72
|
+
|
73
|
+
<p>auth_session is the authentication token generated by CouchDB, to be used for making future requests on behalf of the authenticated user.</p>
|
74
|
+
|
75
|
+
<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;">auth_session.<span style="color:#9900CC;">inspect</span>
|
76
|
+
<span style="color:#008000; font-style:italic;">#=> "b2JpOjRFQzgyQ0U0OlA54YsdHNo8altYRIkLVVeyvwah"</span></pre></div></div>
|
77
|
+
|
78
|
+
<p>To add users to CouchDB see <a href="http://www.whisperservers.com/leanback/wp-content/plugins/really-static/static/couchdb-security/">here</a>.</p>
|
79
|
+
<p>To create a CouchDB database</p>
|
80
|
+
|
81
|
+
<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;">Couchdb.<span style="color:#9900CC;">create</span> <span style="color:#996600;">'contacts'</span>,auth_session
|
82
|
+
<span style="color:#008000; font-style:italic;"># => {"ok"=>true}</span></pre></div></div>
|
83
|
+
|
84
|
+
<p>If you are running an admin party (i.e. you have no admins) simply use the same method with no auth_session parameter. This works for all Leanback methods except when otherwise stated.<br />
|
85
|
+
To create a database in admin party mode:</p>
|
86
|
+
|
87
|
+
<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;">Couchdb.<span style="color:#9900CC;">create</span> <span style="color:#996600;">'contacts'</span>
|
88
|
+
<span style="color:#008000; font-style:italic;"># => {"ok"=>true}</span></pre></div></div>
|
89
|
+
|
90
|
+
<p>Delete a database</p>
|
91
|
+
|
92
|
+
<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;">Couchdb.<span style="color:#9900CC;">delete</span> <span style="color:#996600;">'contacts'</span>,auth_session
|
93
|
+
<span style="color:#008000; font-style:italic;"># => {"ok"=>true}</span></pre></div></div>
|
94
|
+
|
95
|
+
<p>Return a list of all Databases</p>
|
96
|
+
|
97
|
+
<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;">Couchdb.<span style="color:#9900CC;">all</span><span style="color:#006600; font-weight:bold;">(</span>auth_session<span style="color:#006600; font-weight:bold;">)</span>
|
98
|
+
<span style="color:#008000; font-style:italic;"># => ["maps", "inventory", "monitors", "contacts", "books"]</span></pre></div></div>
|
99
|
+
|
100
|
+
<p>Create a new document</p>
|
101
|
+
|
102
|
+
<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;">data = <span style="color:#006600; font-weight:bold;">{</span>:firstname <span style="color:#006600; font-weight:bold;">=></span> <span style="color:#996600;">'Linda'</span>,
|
103
|
+
<span style="color:#ff3333; font-weight:bold;">:lastname</span> <span style="color:#006600; font-weight:bold;">=></span><span style="color:#996600;">'smith'</span>,
|
104
|
+
<span style="color:#ff3333; font-weight:bold;">:phone</span> <span style="color:#006600; font-weight:bold;">=></span> <span style="color:#996600;">'212-234-1234'</span>,
|
105
|
+
<span style="color:#ff3333; font-weight:bold;">:email</span> <span style="color:#006600; font-weight:bold;">=></span><span style="color:#996600;">'john@mail.com'</span><span style="color:#006600; font-weight:bold;">}</span>
|
106
|
+
|
107
|
+
doc = <span style="color:#006600; font-weight:bold;">{</span>:database <span style="color:#006600; font-weight:bold;">=></span> <span style="color:#996600;">'contacts'</span>, <span style="color:#ff3333; font-weight:bold;">:doc_id</span> <span style="color:#006600; font-weight:bold;">=></span> <span style="color:#996600;">'Linda'</span>, <span style="color:#ff3333; font-weight:bold;">:data</span> <span style="color:#006600; font-weight:bold;">=></span> data<span style="color:#006600; font-weight:bold;">}</span>
|
108
|
+
Couchdb.<span style="color:#9900CC;">create_doc</span> doc,auth_session
|
109
|
+
|
110
|
+
<span style="color:#008000; font-style:italic;"># => {"ok"=>true, "id"=>"Linda", "rev"=>"1-6f16274513f51e922ff1f745452a92b6"}</span></pre></div></div>
|
111
|
+
|
112
|
+
<p>This will create a new document in the ‘contacts’ database, with document id ‘Linda’.</p>
|
113
|
+
<p>Let’s update that document to change the email address</p>
|
114
|
+
|
115
|
+
<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;">data = <span style="color:#006600; font-weight:bold;">{</span>:email <span style="color:#006600; font-weight:bold;">=></span> <span style="color:#996600;">"linda@mail.com"</span> <span style="color:#006600; font-weight:bold;">}</span>
|
116
|
+
doc = <span style="color:#006600; font-weight:bold;">{</span> <span style="color:#ff3333; font-weight:bold;">:database</span> <span style="color:#006600; font-weight:bold;">=></span> <span style="color:#996600;">'contacts'</span>, <span style="color:#ff3333; font-weight:bold;">:doc_id</span> <span style="color:#006600; font-weight:bold;">=></span> <span style="color:#996600;">'Linda'</span>, <span style="color:#ff3333; font-weight:bold;">:data</span> <span style="color:#006600; font-weight:bold;">=></span> data<span style="color:#006600; font-weight:bold;">}</span>
|
117
|
+
Couchdb.<span style="color:#9900CC;">update_doc</span> doc,auth_session</pre></div></div>
|
118
|
+
|
119
|
+
<p>Let’s add gender and age</p>
|
120
|
+
|
121
|
+
<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;">data = <span style="color:#006600; font-weight:bold;">{</span>:age <span style="color:#006600; font-weight:bold;">=></span> <span style="color:#996600;">"32"</span>, <span style="color:#ff3333; font-weight:bold;">:gender</span> <span style="color:#006600; font-weight:bold;">=></span> <span style="color:#996600;">"female"</span> <span style="color:#006600; font-weight:bold;">}</span>
|
122
|
+
doc = <span style="color:#006600; font-weight:bold;">{</span> <span style="color:#ff3333; font-weight:bold;">:database</span> <span style="color:#006600; font-weight:bold;">=></span> <span style="color:#996600;">'contacts'</span>, <span style="color:#ff3333; font-weight:bold;">:doc_id</span> <span style="color:#006600; font-weight:bold;">=></span> <span style="color:#996600;">'Linda'</span>, <span style="color:#ff3333; font-weight:bold;">:data</span> <span style="color:#006600; font-weight:bold;">=></span> data<span style="color:#006600; font-weight:bold;">}</span>
|
123
|
+
Couchdb.<span style="color:#9900CC;">update_doc</span> doc,auth_session</pre></div></div>
|
124
|
+
|
125
|
+
<p>To change phone# and add a fax number</p>
|
126
|
+
|
127
|
+
<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;">data = <span style="color:#006600; font-weight:bold;">{</span>:phone <span style="color:#006600; font-weight:bold;">=></span> <span style="color:#996600;">"718-234-2904"</span>,:fax <span style="color:#006600; font-weight:bold;">=></span> <span style="color:#996600;">"646-309-4049"</span> <span style="color:#006600; font-weight:bold;">}</span>
|
128
|
+
doc = <span style="color:#006600; font-weight:bold;">{</span> <span style="color:#ff3333; font-weight:bold;">:database</span> <span style="color:#006600; font-weight:bold;">=></span> <span style="color:#996600;">'contacts'</span>, <span style="color:#ff3333; font-weight:bold;">:doc_id</span> <span style="color:#006600; font-weight:bold;">=></span> <span style="color:#996600;">'Linda'</span>, <span style="color:#ff3333; font-weight:bold;">:data</span> <span style="color:#006600; font-weight:bold;">=></span> data<span style="color:#006600; font-weight:bold;">}</span>
|
129
|
+
Couchdb.<span style="color:#9900CC;">update_doc</span> doc,auth_session</pre></div></div>
|
130
|
+
|
131
|
+
<p>Let’s add twitter account, facebook account and website url</p>
|
132
|
+
|
133
|
+
<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;">data = <span style="color:#006600; font-weight:bold;">{</span> <span style="color:#ff3333; font-weight:bold;">:twitter</span> <span style="color:#006600; font-weight:bold;">=></span> <span style="color:#996600;">"http://twitter.com/#!/linda"</span>,
|
134
|
+
<span style="color:#ff3333; font-weight:bold;">:faceboook</span> <span style="color:#006600; font-weight:bold;">=></span> <span style="color:#996600;">"http://facebook.com/linda"</span>,
|
135
|
+
<span style="color:#ff3333; font-weight:bold;">:website</span> <span style="color:#006600; font-weight:bold;">=></span> <span style="color:#996600;">"http://linda-blogs.com"</span> <span style="color:#006600; font-weight:bold;">}</span>
|
136
|
+
|
137
|
+
doc = <span style="color:#006600; font-weight:bold;">{</span> <span style="color:#ff3333; font-weight:bold;">:database</span> <span style="color:#006600; font-weight:bold;">=></span> <span style="color:#996600;">'contacts'</span>, <span style="color:#ff3333; font-weight:bold;">:doc_id</span> <span style="color:#006600; font-weight:bold;">=></span> <span style="color:#996600;">'Linda'</span>, <span style="color:#ff3333; font-weight:bold;">:data</span> <span style="color:#006600; font-weight:bold;">=></span> data<span style="color:#006600; font-weight:bold;">}</span>
|
138
|
+
Couchdb.<span style="color:#9900CC;">update_doc</span> doc,auth_session</pre></div></div>
|
139
|
+
|
140
|
+
<p>Retrieve/view the document</p>
|
141
|
+
|
142
|
+
<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;">doc = <span style="color:#006600; font-weight:bold;">{</span>:database <span style="color:#006600; font-weight:bold;">=></span> <span style="color:#996600;">'contacts'</span>, <span style="color:#ff3333; font-weight:bold;">:doc_id</span> <span style="color:#006600; font-weight:bold;">=></span> <span style="color:#996600;">'Linda'</span><span style="color:#006600; font-weight:bold;">}</span>
|
143
|
+
Couchdb.<span style="color:#9900CC;">view</span> doc,auth_session
|
144
|
+
|
145
|
+
<span style="color:#008000; font-style:italic;">#=> {"_id"=>"Linda", "_rev"=>"5-f99fd63f2c784b5e2f7b7d92b2df9a1e", "firstname"=>"Linda", "lastname"=>"smith", </span>
|
146
|
+
<span style="color:#008000; font-style:italic;"># "phone"=>"718-234-2904", "email"=>"linda@mail.com", "age"=>"32", "gender"=>"female", "fax"=>"646-309-4049", "twitter"=>"http://twitter.com/#!/linda",</span>
|
147
|
+
<span style="color:#008000; font-style:italic;"># "faceboook"=>"http://facebook.com/linda", "website"=>"http://linda-blogs.com"}</span></pre></div></div>
|
148
|
+
|
149
|
+
<p>To edit the document and replace it with a new one</p>
|
150
|
+
|
151
|
+
<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;">data = <span style="color:#006600; font-weight:bold;">{</span>:firstname <span style="color:#006600; font-weight:bold;">=></span> <span style="color:#996600;">'Linda'</span>,
|
152
|
+
<span style="color:#ff3333; font-weight:bold;">:lastname</span> <span style="color:#006600; font-weight:bold;">=></span><span style="color:#996600;">'smith'</span>,
|
153
|
+
<span style="color:#ff3333; font-weight:bold;">:email</span> <span style="color:#006600; font-weight:bold;">=></span> <span style="color:#996600;">'linda@mail.com'</span>,
|
154
|
+
<span style="color:#ff3333; font-weight:bold;">:gender</span><span style="color:#006600; font-weight:bold;">=></span><span style="color:#996600;">'female'</span>,
|
155
|
+
<span style="color:#ff3333; font-weight:bold;">:phone</span> <span style="color:#006600; font-weight:bold;">=></span><span style="color:#996600;">'718-245-5611'</span>,
|
156
|
+
<span style="color:#ff3333; font-weight:bold;">:_rev</span><span style="color:#006600; font-weight:bold;">=></span><span style="color:#996600;">'5-f99fd63f2c784b5e2f7b7d92b2df9a1e'</span><span style="color:#006600; font-weight:bold;">}</span>
|
157
|
+
|
158
|
+
doc = <span style="color:#006600; font-weight:bold;">{</span>:database <span style="color:#006600; font-weight:bold;">=></span> <span style="color:#996600;">'contacts'</span>, <span style="color:#ff3333; font-weight:bold;">:doc_id</span> <span style="color:#006600; font-weight:bold;">=></span> <span style="color:#996600;">'Linda'</span>, <span style="color:#ff3333; font-weight:bold;">:data</span> <span style="color:#006600; font-weight:bold;">=></span> data<span style="color:#006600; font-weight:bold;">}</span>
|
159
|
+
Couchdb.<span style="color:#9900CC;">edit_doc</span> doc,auth_session
|
160
|
+
|
161
|
+
<span style="color:#008000; font-style:italic;"># => {"ok"=>true, "id"=>"Linda", "rev"=>"6-211ebb68bdd4ba8799387214b4a3b445"}</span></pre></div></div>
|
162
|
+
|
163
|
+
<p>This replaces the existing document with a new one, the _rev number of the document must be included in the data.</p>
|
164
|
+
<p>Retrieve/view the document</p>
|
165
|
+
|
166
|
+
<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;">doc = <span style="color:#006600; font-weight:bold;">{</span>:database <span style="color:#006600; font-weight:bold;">=></span> <span style="color:#996600;">'contacts'</span>, <span style="color:#ff3333; font-weight:bold;">:doc_id</span> <span style="color:#006600; font-weight:bold;">=></span> <span style="color:#996600;">'Linda'</span><span style="color:#006600; font-weight:bold;">}</span>
|
167
|
+
Couchdb.<span style="color:#9900CC;">view</span> doc,auth_session
|
168
|
+
|
169
|
+
<span style="color:#008000; font-style:italic;">#=> {"_id"=>"Linda", "_rev"=>"6-211ebb68bdd4ba8799387214b4a3b445", "firstname"=>"Linda", </span>
|
170
|
+
<span style="color:#008000; font-style:italic;"># "lastname"=>"smith", "email"=>"linda@mail.com", "gender"=>"female", "phone"=>"718-245-5611"}</span></pre></div></div>
|
171
|
+
|
172
|
+
<p>Delete the document</p>
|
173
|
+
|
174
|
+
<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;"> doc = <span style="color:#006600; font-weight:bold;">{</span>:database <span style="color:#006600; font-weight:bold;">=></span> <span style="color:#996600;">'contacts'</span>, <span style="color:#ff3333; font-weight:bold;">:doc_id</span> <span style="color:#006600; font-weight:bold;">=></span> <span style="color:#996600;">'Linda'</span><span style="color:#006600; font-weight:bold;">}</span>
|
175
|
+
Couchdb.<span style="color:#9900CC;">delete_doc</span> doc,auth_session
|
176
|
+
|
177
|
+
<span style="color:#008000; font-style:italic;">#=> {"ok"=>true, "id"=>"Linda", "rev"=>"7-a2cfbbb607a668c26256bc19ff270ecf"}</span></pre></div></div>
|
178
|
+
|
179
|
+
<p>Delete the document using it’s revision number (_rev):</p>
|
180
|
+
|
181
|
+
<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;">doc = <span style="color:#006600; font-weight:bold;">{</span>:database <span style="color:#006600; font-weight:bold;">=></span> <span style="color:#996600;">'contacts'</span>,
|
182
|
+
<span style="color:#ff3333; font-weight:bold;">:doc_id</span> <span style="color:#006600; font-weight:bold;">=></span> <span style="color:#996600;">'Linda'</span>, <span style="color:#ff3333; font-weight:bold;">:rev</span> <span style="color:#006600; font-weight:bold;">=></span> <span style="color:#996600;">'2-e813a0e902e3ac114400ff3959a2adde'</span><span style="color:#006600; font-weight:bold;">}</span>
|
183
|
+
|
184
|
+
Couchdb.<span style="color:#9900CC;">delete_rev</span> doc,auth_session
|
185
|
+
|
186
|
+
<span style="color:#008000; font-style:italic;">#=> {"ok"=>true, "id"=>"Linda", "rev"=>"3-48580d1806983b32cb03f114efb064e3"}</span></pre></div></div>
|
187
|
+
|
188
|
+
<p>Retrieve all documents in a database</p>
|
189
|
+
|
190
|
+
<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;">docs = Couchdb.<span style="color:#9900CC;">docs_from</span> <span style="color:#996600;">'contacts'</span>,auth_session
|
191
|
+
docs.<span style="color:#9900CC;">each</span> <span style="color:#9966CC; font-weight:bold;">do</span> <span style="color:#006600; font-weight:bold;">|</span>d<span style="color:#006600; font-weight:bold;">|</span>
|
192
|
+
<span style="color:#CC0066; font-weight:bold;">puts</span> d<span style="color:#006600; font-weight:bold;">[</span><span style="color:#996600;">"_rev"</span><span style="color:#006600; font-weight:bold;">]</span>
|
193
|
+
<span style="color:#CC0066; font-weight:bold;">puts</span> d<span style="color:#006600; font-weight:bold;">[</span><span style="color:#996600;">"_id"</span><span style="color:#006600; font-weight:bold;">]</span>
|
194
|
+
<span style="color:#CC0066; font-weight:bold;">puts</span> d<span style="color:#006600; font-weight:bold;">[</span><span style="color:#996600;">"firstname"</span><span style="color:#006600; font-weight:bold;">]</span>
|
195
|
+
<span style="color:#CC0066; font-weight:bold;">puts</span> d<span style="color:#006600; font-weight:bold;">[</span><span style="color:#996600;">"lastname"</span><span style="color:#006600; font-weight:bold;">]</span>
|
196
|
+
<span style="color:#CC0066; font-weight:bold;">puts</span> d<span style="color:#006600; font-weight:bold;">[</span><span style="color:#996600;">"email"</span><span style="color:#006600; font-weight:bold;">]</span>
|
197
|
+
<span style="color:#CC0066; font-weight:bold;">puts</span> d<span style="color:#006600; font-weight:bold;">[</span><span style="color:#996600;">"phone"</span><span style="color:#006600; font-weight:bold;">]</span>
|
198
|
+
<span style="color:#9966CC; font-weight:bold;">end</span></pre></div></div>
|
199
|
+
|
200
|
+
</div><!-- .entry-content -->
|
201
|
+
|
202
|
+
|
203
|
+
</div><!-- .hentry -->
|
204
|
+
|
205
|
+
|
206
|
+
|
207
|
+
|
208
|
+
|
209
|
+
|
210
|
+
|
211
|
+
</div><!-- .content .hfeed -->
|
212
|
+
|
213
|
+
|
214
|
+
<div id="primary" class="sidebar aside">
|
215
|
+
|
216
|
+
|
217
|
+
<div id="hybrid-nav-menu-3" class="widget nav-menu widget-nav-menu"><div class="widget-wrap widget-inside"><h3 class="widget-title">Leanback</h3><div class="menu-sidebar-container"><ul id="menu-sidebar" class="nav-menu"><li id="menu-item-13" class="menu-item menu-item-type-post_type menu-item-object-page current-menu-ancestor current-menu-parent current_page_parent current_page_ancestor menu-item-13"><a href="http://www.whisperservers.com/leanback/wp-content/plugins/really-static/static/leanback/">Leanback</a><ul class="sub-menu"><li id="menu-item-14" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-14"><a href="http://www.whisperservers.com/leanback/wp-content/plugins/really-static/static/leanback/installation/">Install</a></li><li id="menu-item-15" class="menu-item menu-item-type-post_type menu-item-object-page current-menu-item page_item page-item-11 current_page_item menu-item-15"><a href="http://www.whisperservers.com/leanback/wp-content/plugins/really-static/static/basic-couchdb-operations/">Basic CouchDB Operations</a></li><li id="menu-item-41" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-41"><a href="http://www.whisperservers.com/leanback/wp-content/plugins/really-static/static/find-documents-by-key/">Find documents by key</a></li><li id="menu-item-167" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-167"><a href="http://www.whisperservers.com/leanback/wp-content/plugins/really-static/static/find-document-by-multiple-keys/">Find document by multiple Keys</a></li><li id="menu-item-140" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-140"><a href="http://www.whisperservers.com/leanback/wp-content/plugins/really-static/static/count-documents-by-key/">Count documents by key</a></li><li id="menu-item-175" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-175"><a href="http://www.whisperservers.com/leanback/wp-content/plugins/really-static/static/count-by-multiple-documents/">Count documents by multiple keys</a></li><li id="menu-item-45" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-45"><a href="http://www.whisperservers.com/leanback/wp-content/plugins/really-static/static/design-documents-and-permanent-views/">Working with CouchDB views</a></li><li id="menu-item-67" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-67"><a href="http://www.whisperservers.com/leanback/wp-content/plugins/really-static/static/error-handling/">Error handling</a></li><li id="menu-item-96" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-96"><a href="http://www.whisperservers.com/leanback/wp-content/plugins/really-static/static/couchdb-configuration/">CouchDB Configuration</a></li><li id="menu-item-102" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-102"><a href="http://www.whisperservers.com/leanback/wp-content/plugins/really-static/static/couchdb-security/">CouchDB Security</a></li><li id="menu-item-105" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-105"><a href="http://www.whisperservers.com/leanback/wp-content/plugins/really-static/static/setting-the-bind_address-port/">CouchDB Bind_Address & Port</a></li></ul></li><li id="menu-item-142" class="menu-item menu-item-type-custom menu-item-object-custom menu-item-142"><a href="https://github.com/obi-a/leanback/blob/master/Changelog.rdoc">Changes</a></li><li id="menu-item-78" class="menu-item menu-item-type-custom menu-item-object-custom menu-item-78"><a href="https://github.com/obi-a/leanback">Source Code</a></li></ul></div></div></div>
|
218
|
+
|
219
|
+
</div><!-- #primary .aside -->
|
220
|
+
|
221
|
+
|
222
|
+
</div><!-- #container -->
|
223
|
+
|
224
|
+
<div id="footer-container">
|
225
|
+
|
226
|
+
|
227
|
+
<div id="footer">
|
228
|
+
|
229
|
+
<div class="footer-insert"><p class="copyright">Copyright © 2013 <a href="http://obi-akubue.org">obi-akubue.org</a>.</p></div>
|
230
|
+
</div><!-- #footer -->
|
231
|
+
|
232
|
+
|
233
|
+
</div><!-- #footer-container -->
|
234
|
+
|
235
|
+
</div><!-- #body-container -->
|
236
|
+
|
237
|
+
|
238
|
+
<script type="text/javascript">
|
239
|
+
|
240
|
+
var _gaq = _gaq || [];
|
241
|
+
_gaq.push(['_setAccount', 'UA-20190925-6']);
|
242
|
+
_gaq.push(['_trackPageview']);
|
243
|
+
|
244
|
+
(function() {
|
245
|
+
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
|
246
|
+
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
|
247
|
+
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(ga);
|
248
|
+
})();
|
249
|
+
</script>
|
250
|
+
|
251
|
+
<a style='color:transparent;position:absolute;left:-99999px;z-index:-99999' href='http://www.wpdownloadmanager.com/' title='Premium Wordpress Plugin download manager'>Premium Wordpress Plugin</a>
|
252
|
+
<script type='text/javascript' src='http://www.whisperservers.com/leanback/wp-content/themes/hybrid/library/js/drop-downs.js?ver=20110705'></script>
|
253
|
+
|
254
|
+
</body>
|
255
|
+
</html>
|
256
|
+
<!-- Dynamic page generated in 0.482 seconds. -->
|
257
|
+
<!-- Cached page generated by WP-Super-Cache on 2013-06-09 16:29:30 -->
|
258
|
+
|
259
|
+
<!-- super cache -->
|