<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
<title>user@couchdb.apache.org Archives</title>
<link rel="self" href="http://mail-archives.apache.org/mod_mbox/couchdb-user/?format=atom"/>
<link href="http://mail-archives.apache.org/mod_mbox/couchdb-user/"/>
<id>http://mail-archives.apache.org/mod_mbox/couchdb-user/</id>
<updated>2009-12-08T03:26:13Z</updated>
<entry>
<title>Re: couchdb-lucene</title>
<author><name>=?iso-8859-1?q?S=F8ren_Hilmer?= &lt;sh@widetrail.dk&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/couchdb-user/200912.mbox/%3c200912080059.26175.sh@widetrail.dk%3e"/>
<id>urn:uuid:%3c200912080059-26175-sh@widetrail-dk%3e</id>
<updated>2009-12-07T23:59:26Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
I'm running a trunk  build of couchdb, thought that counted as 0.11+ will try 
with c-l 0-4 maint, thanks.

--Søren


On Tuesday 08 December 2009 00:11:47 Sebastian Cohnen wrote:
&gt; hey søren,
&gt;
&gt; you want to have a look at c-l 0.4:
&gt; http://github.com/rnewson/couchdb-lucene/tree/0.4-maint (see the readme
&gt; there for [update_notification]). c-l 0.5 (current master, unstable/dev)
&gt; uses the _changes-API to "see" changes to documents.
&gt;
&gt;
&gt; Sebastian
&gt;
&gt; On 07.12.2009, at 23:59, Søren Hilmer wrote:
&gt; &gt; Hi
&gt; &gt;
&gt; &gt; I took the latest couchdb-lucene for a spin, but I believe something is
&gt; &gt; missing in how this is to be configured.
&gt; &gt; Shouldn't there be a setting in the [update_notification] section?
&gt; &gt; I cannot see how couchdb can notify the couchdb-lucene server otherwise,
&gt; &gt; or am I missing something?
&gt; &gt;
&gt; &gt; Great improvement that it is now a standalone server and not spawned by
&gt; &gt; couch!
&gt; &gt;
&gt; &gt; --Søren
&gt; &gt; --
&gt; &gt; Søren Hilmer, M.Sc., M.Crypt.
&gt; &gt; wideTrail                       Phone:  +45 25481225
&gt; &gt; Pilevænget 41           Email:  sh@widetrail.dk
&gt; &gt; DK-8961  Allingåbro     Web:    www.widetrail.dk


-- 
Søren Hilmer, M.Sc., M.Crypt.
wideTrail                       Phone:  +45 25481225
Pilevænget 41           Email:  sh@widetrail.dk
DK-8961  Allingåbro     Web:    www.widetrail.dk


</pre>
</div>
</content>
</entry>
<entry>
<title>Re: couchdb-lucene</title>
<author><name>Sebastian Cohnen &lt;sebastiancohnen@googlemail.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/couchdb-user/200912.mbox/%3c9C2783B7-6887-49F8-8EE2-5CB479095EA6@googlemail.com%3e"/>
<id>urn:uuid:%3c9C2783B7-6887-49F8-8EE2-5CB479095EA6@googlemail-com%3e</id>
<updated>2009-12-07T23:11:47Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
hey søren,

you want to have a look at c-l 0.4: http://github.com/rnewson/couchdb-lucene/tree/0.4-maint
(see the readme there for [update_notification]). c-l 0.5 (current master, unstable/dev) uses
the _changes-API to "see" changes to documents.


Sebastian

On 07.12.2009, at 23:59, Søren Hilmer wrote:

&gt; Hi
&gt; 
&gt; I took the latest couchdb-lucene for a spin, but I believe something is 
&gt; missing in how this is to be configured.
&gt; Shouldn't there be a setting in the [update_notification] section?
&gt; I cannot see how couchdb can notify the couchdb-lucene server otherwise, or am 
&gt; I missing something?
&gt; 
&gt; Great improvement that it is now a standalone server and not spawned by couch!
&gt; 
&gt; --Søren
&gt; -- 
&gt; Søren Hilmer, M.Sc., M.Crypt.
&gt; wideTrail                       Phone:  +45 25481225
&gt; Pilevænget 41           Email:  sh@widetrail.dk
&gt; DK-8961  Allingåbro     Web:    www.widetrail.dk



</pre>
</div>
</content>
</entry>
<entry>
<title>couchdb-lucene</title>
<author><name>=?iso-8859-1?q?S=F8ren_Hilmer?= &lt;sh@widetrail.dk&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/couchdb-user/200912.mbox/%3c200912072359.54346.sh@widetrail.dk%3e"/>
<id>urn:uuid:%3c200912072359-54346-sh@widetrail-dk%3e</id>
<updated>2009-12-07T22:59:54Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Hi

I took the latest couchdb-lucene for a spin, but I believe something is 
missing in how this is to be configured.
Shouldn't there be a setting in the [update_notification] section?
I cannot see how couchdb can notify the couchdb-lucene server otherwise, or am 
I missing something?

Great improvement that it is now a standalone server and not spawned by couch!

--Søren
-- 
Søren Hilmer, M.Sc., M.Crypt.
wideTrail                       Phone:  +45 25481225
Pilevænget 41           Email:  sh@widetrail.dk
DK-8961  Allingåbro     Web:    www.widetrail.dk


</pre>
</div>
</content>
</entry>
<entry>
<title>Re: Reducible checksum?</title>
<author><name>Chris Anderson &lt;jchris@apache.org&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/couchdb-user/200912.mbox/%3ce282921e0912071427t11b2f4ccqadaae404c5c780f5@mail.gmail.com%3e"/>
<id>urn:uuid:%3ce282921e0912071427t11b2f4ccqadaae404c5c780f5@mail-gmail-com%3e</id>
<updated>2009-12-07T22:27:18Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
On Mon, Dec 7, 2009 at 2:34 AM, Brian Candler &lt;B.Candler@pobox.com&gt; wrote:
&gt; I am thinking about storing some derived data which is associated with key
&gt; ranges of a view. (Example: an image which provides a graphical summary of a
&gt; key range).
&gt;
&gt; I would like to determine when it's time to regenerate an image, that is,
&gt; when the underlying view has changed within that range.
&gt;
&gt; One thought I had was if I could make a reduce function which was some sort
&gt; of checksum of the key/value pairs. Then I could just do a reduce query
&gt; across the key range, and see if the reduce value has changed. It would be
&gt; like an etag for the range.
&gt;
&gt; Unfortunately, I can't just do something simple like an md5sum across the
&gt; range, because couchdb implements a tree of reduces and re-reduces, and may
&gt; decide to restructure this tree. I'd like a checksum which is invariant
&gt; across all possible reduce trees for the same data.
&gt;
&gt; Something simple would be to XOR all the keys and values together, but
&gt; sometimes this would not detect changes which happen to XOR to the same
&gt; data.
&gt;
&gt; Perhaps I should md5 each (key,value) pair, and then XOR all those together
&gt; in the reduce function.
&gt;
&gt; Since my docs have updated timestamps, maybe I should just take the max() of
&gt; the updated timestamp for each doc, together with a count of the docs (so as
&gt; to be able to detect deletions)

This is a great question. If there's a generic way to do this, and it
is cheap enough, it could be generalized to handle view etags. Your
row count + max timestamp trick seems sensible to me, but obviously is
not generalizable.

Presumably you could avoid hashing the keys and values by leaning on
the document._rev. However, that just pushes the problem back a step.

What we need for a general solution is a commutative and associated
checksum function, which would be a funny beast indeed.

Chris

&gt;
&gt; I just wondered if anyone had already made an elegant solution for this? Or
&gt; some completely different way of determining whether a view has changed
&gt; between a given startkey and endkey?
&gt;
&gt; Thanks,
&gt;
&gt; Brian.
&gt;



-- 
Chris Anderson
http://jchrisa.net
http://couch.io


</pre>
</div>
</content>
</entry>
<entry>
<title>Reducible checksum?</title>
<author><name>Brian Candler &lt;B.Candler@pobox.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/couchdb-user/200912.mbox/%3c20091207103453.GB5146@uk.tiscali.com%3e"/>
<id>urn:uuid:%3c20091207103453-GB5146@uk-tiscali-com%3e</id>
<updated>2009-12-07T10:34:53Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
I am thinking about storing some derived data which is associated with key
ranges of a view. (Example: an image which provides a graphical summary of a
key range).

I would like to determine when it's time to regenerate an image, that is,
when the underlying view has changed within that range.

One thought I had was if I could make a reduce function which was some sort
of checksum of the key/value pairs. Then I could just do a reduce query
across the key range, and see if the reduce value has changed. It would be
like an etag for the range.

Unfortunately, I can't just do something simple like an md5sum across the
range, because couchdb implements a tree of reduces and re-reduces, and may
decide to restructure this tree. I'd like a checksum which is invariant
across all possible reduce trees for the same data.

Something simple would be to XOR all the keys and values together, but
sometimes this would not detect changes which happen to XOR to the same
data.

Perhaps I should md5 each (key,value) pair, and then XOR all those together
in the reduce function.

Since my docs have updated timestamps, maybe I should just take the max() of
the updated timestamp for each doc, together with a count of the docs (so as
to be able to detect deletions)

I just wondered if anyone had already made an elegant solution for this? Or
some completely different way of determining whether a view has changed
between a given startkey and endkey?

Thanks,

Brian.


</pre>
</div>
</content>
</entry>
<entry>
<title>Re: Design Question</title>
<author><name>Chris Anderson &lt;jchris@apache.org&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/couchdb-user/200912.mbox/%3ce282921e0912061604q75f18e47w41e2d2833f10c5a4@mail.gmail.com%3e"/>
<id>urn:uuid:%3ce282921e0912061604q75f18e47w41e2d2833f10c5a4@mail-gmail-com%3e</id>
<updated>2009-12-07T00:04:49Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
On Sun, Dec 6, 2009 at 2:48 PM, Matthew M. Gamble &lt;mgamble@mgamble.ca&gt; wrote:
&gt; Thanks Roger!
&gt;
&gt; If I go down the "one user, one DB" path is there a limit to the number of databases
I can create?  Any performance issues with having 100k+ unique databases?

Couch has been tested and works fine with millions of databases. If
you need to spread them across directories, create them with a "/" in
the name (properly escaped in the url, of course) and couch will
create subdirectories to hold the files.

&gt;
&gt;
&gt; ------Original Message------
&gt; From: Roger Binns
&gt; To: user@couchdb.apache.org
&gt; ReplyTo: user@couchdb.apache.org
&gt; Subject: Re: Design Question
&gt; Sent: Dec 6, 2009 5:25 PM
&gt;
&gt; -----BEGIN PGP SIGNED MESSAGE-----
&gt; Hash: SHA1
&gt;
&gt; Matthew Gamble wrote:
&gt;&gt; I'm sorry if a question like this has been asked
&gt;&gt; before, but I couldn't find anything in the archives that was quite the same
&gt;&gt; as what I'm trying to do.
&gt;
&gt; There indeed was a similar discussion.  One of the final conclusions was
&gt; that it would be best to have each user plus their data stored in a separate
&gt; DB.  The reason for this is that it makes the security rules easier to
&gt; define and also makes more sense for replication.  (Presumably you want to
&gt; eventually allow the users to run a personal CouchDB with the same database.)
&gt;
&gt;&gt; attachment but that made it very hard to search the data as it required the
&gt;
&gt; May be helpful http://wiki.apache.org/couchdb/Full_text_search
&gt;
&gt;&gt; Or is it best to put each user as their own database and store the address
&gt;&gt; books / VCards as documents?
&gt;
&gt; That would be most natural.  In theory you can write an update handler that
&gt; parses the vCard into fields and makes them keys of the doc.  If you do this
&gt; then the full text search should work really easily.
&gt;
&gt; Roger
&gt; -----BEGIN PGP SIGNATURE-----
&gt; Version: GnuPG v1.4.9 (GNU/Linux)
&gt; Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
&gt;
&gt; iEYEARECAAYFAkscL2oACgkQmOOfHg372QSAwACdGdOXBMw9W7a5jLAeXPHGGz27
&gt; Za4An3KylQT6Z788a09Nr1MOH2jiXeFU
&gt; =AJpY
&gt; -----END PGP SIGNATURE-----
&gt;
&gt;
&gt; Sent from my BlackBerry device on the Rogers Wireless Network



-- 
Chris Anderson
http://jchrisa.net
http://couch.io


</pre>
</div>
</content>
</entry>
<entry>
<title>Re: Design Question</title>
<author><name>Roger Binns &lt;rogerb@rogerbinns.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/couchdb-user/200912.mbox/%3c4B1C4454.5070002@rogerbinns.com%3e"/>
<id>urn:uuid:%3c4B1C4454-5070002@rogerbinns-com%3e</id>
<updated>2009-12-06T23:55:00Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Matthew M. Gamble wrote:
&gt; If I go down the "one user, one DB" path is there a limit to the number of databases
I can create?  Any performance issues with having 100k+ unique databases?  

The database names are constrained (so they are unambiguous on the
filesystem - eg only lowercase ascii but you could probably base64 encode
the names if needed).  You would have problems if the underlying filesystem
is crummy - each database corresponds to a file so the filesystem should
handle that number of files.  Consequently using a NTFS filesystem while
running a virus scanner would be a bad idea :-)  Modern Linux filesystems
are fine.  You will likely also have to increase some tunables in the script
starting CouchDB such as the number of open file handles.

However only you can decide what you consider acceptable performance and
what is representative data.  You should be able to construct an appropriate
benchmark using your favourite scripting language with CouchDB bindings in a
few hours (or less!).  Do please report back the numbers you get.

  http://books.couchdb.org/relax/reference/high-performance

This will help for ulimit setting:

  https://issues.apache.org/jira/browse/COUCHDB-590

Roger
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkscRFQACgkQmOOfHg372QTn3QCdGcmVNf3Mq2H+rIkFrZvxLyaK
fTsAoIr6UyXb+l4jrkyzzyfPHEaUry/C
=BCAe
-----END PGP SIGNATURE-----


</pre>
</div>
</content>
</entry>
<entry>
<title>Re: Design Question</title>
<author><name>&quot;Matthew M. Gamble&quot; &lt;mgamble@mgamble.ca&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/couchdb-user/200912.mbox/%3c1086555203-1260139694-cardhu_decombobulator_blackberry.rim.net-292363942-@bda344.bisx.prod.on.blackberry%3e"/>
<id>urn:uuid:%3c1086555203-1260139694-cardhu_decombobulator_blackberry-rim-net-292363942-@bda344-bisx-prod-on-blackberry%3e</id>
<updated>2009-12-06T22:48:12Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Thanks Roger!

If I go down the "one user, one DB" path is there a limit to the number of databases I can
create?  Any performance issues with having 100k+ unique databases?  

 
------Original Message------
From: Roger Binns
To: user@couchdb.apache.org
ReplyTo: user@couchdb.apache.org
Subject: Re: Design Question
Sent: Dec 6, 2009 5:25 PM

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Matthew Gamble wrote:
&gt; I'm sorry if a question like this has been asked
&gt; before, but I couldn't find anything in the archives that was quite the same
&gt; as what I'm trying to do.

There indeed was a similar discussion.  One of the final conclusions was
that it would be best to have each user plus their data stored in a separate
DB.  The reason for this is that it makes the security rules easier to
define and also makes more sense for replication.  (Presumably you want to
eventually allow the users to run a personal CouchDB with the same database.)

&gt; attachment but that made it very hard to search the data as it required the

May be helpful http://wiki.apache.org/couchdb/Full_text_search

&gt; Or is it best to put each user as their own database and store the address
&gt; books / VCards as documents?

That would be most natural.  In theory you can write an update handler that
parses the vCard into fields and makes them keys of the doc.  If you do this
then the full text search should work really easily.

Roger
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkscL2oACgkQmOOfHg372QSAwACdGdOXBMw9W7a5jLAeXPHGGz27
Za4An3KylQT6Z788a09Nr1MOH2jiXeFU
=AJpY
-----END PGP SIGNATURE-----


Sent from my BlackBerry device on the Rogers Wireless Network
</pre>
</div>
</content>
</entry>
<entry>
<title>Re: Design Question</title>
<author><name>Roger Binns &lt;rogerb@rogerbinns.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/couchdb-user/200912.mbox/%3c4B1C2F6A.1070506@rogerbinns.com%3e"/>
<id>urn:uuid:%3c4B1C2F6A-1070506@rogerbinns-com%3e</id>
<updated>2009-12-06T22:25:46Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Matthew Gamble wrote:
&gt; I'm sorry if a question like this has been asked
&gt; before, but I couldn't find anything in the archives that was quite the same
&gt; as what I'm trying to do.

There indeed was a similar discussion.  One of the final conclusions was
that it would be best to have each user plus their data stored in a separate
DB.  The reason for this is that it makes the security rules easier to
define and also makes more sense for replication.  (Presumably you want to
eventually allow the users to run a personal CouchDB with the same database.)

&gt; attachment but that made it very hard to search the data as it required the

May be helpful http://wiki.apache.org/couchdb/Full_text_search

&gt; Or is it best to put each user as their own database and store the address
&gt; books / VCards as documents?

That would be most natural.  In theory you can write an update handler that
parses the vCard into fields and makes them keys of the doc.  If you do this
then the full text search should work really easily.

Roger
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkscL2oACgkQmOOfHg372QSAwACdGdOXBMw9W7a5jLAeXPHGGz27
Za4An3KylQT6Z788a09Nr1MOH2jiXeFU
=AJpY
-----END PGP SIGNATURE-----


</pre>
</div>
</content>
</entry>
<entry>
<title>Design Question</title>
<author><name>Matthew Gamble &lt;mgamble@mgamble.ca&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/couchdb-user/200912.mbox/%3c741a4d620912061401s172d43d2pf2a84ae2d3589150@mail.gmail.com%3e"/>
<id>urn:uuid:%3c741a4d620912061401s172d43d2pf2a84ae2d3589150@mail-gmail-com%3e</id>
<updated>2009-12-06T22:01:24Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
I'm been trying to wrap my head around how to layout my application in
couchDB for the past few days and I can't seem to figure out which is the
best way of doing it.  I'm sorry if a question like this has been asked
before, but I couldn't find anything in the archives that was quite the same
as what I'm trying to do.

In a nutshell, I'd like to store addresses (VCard like data) for users.  My
first thought was a single document per-user with each VCard as an
attachment but that made it very hard to search the data as it required the
client side to download and parse everything for a search.

My next idea was a document for each VCard and a key (user_id, for example)
to denote which user the card belongs to.  This is quick to access with a
view, and might be the right way to do this?

Or is it best to put each user as their own database and store the address
books / VCards as documents?

To give you an idea of the scale, I'm looking at 100-200k unique users with
(up to) 5000 VCards each.  I really like the idea of using CouchDB to store
the address book / vcard data as it lets me only enter the data that's
actual used.

Thanks in advance for any advice - like I said, I'm still trying to wrap my
head around the way CouchDB works.


</pre>
</div>
</content>
</entry>
<entry>
<title>ho to notify a client that it's time to update his views?</title>
<author><name>Matteo Caprari &lt;matteo.caprari@gmail.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/couchdb-user/200912.mbox/%3c1bca98390912060430k44f56df7h62a7bff7b8fac71e@mail.gmail.com%3e"/>
<id>urn:uuid:%3c1bca98390912060430k44f56df7h62a7bff7b8fac71e@mail-gmail-com%3e</id>
<updated>2009-12-06T12:30:35Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Hi.

While my couchdb application is very quiet most of the time, sometimes
there is a burst of activity:
tens or hundreds of documents are created and updated in few seconds.
There are many users logged on the system, but each burst is relevant
only for one of them.

When this bursts happen, I want to suggest the user's browser to
reload his views. Clients are connected to a queue via cometd,
messages can be pushed to them.

An approach may be to write a _changes listener that sends a message
to a client when it thinks best, but there's a catch: to know which
client to notify, the proces would either have to download the
documents or I'd have to create one listener for each user, which
would mean one http connection per user. Not that http connections are
a bad thing, but I'm still shy with too many of them around...

Another approach would be to execute a view that counts the documents
for each user and sends a message to  the ones for which the count has
changed since last execution.

I'm sure I'm not seeing better solutions. Suggestions anyone?

Thanks!

Notes:

Connecting each client to the _changes API is not welcome because each
client is already using one connection with a comet server.
Also, there are different classes of documents associated with
different views,  and I'd end up with multiple connections to
differently filtered _changes.

Of course the processes that create and update the documents know
which user owns the document. I could have them send a message when
due, but I was hoping to keep generators and consumers as decoupled as
possible, with couchdb in the middle.
-- 
:Matteo Caprari
matteo.caprari@gmail.com


</pre>
</div>
</content>
</entry>
<entry>
<title>Re: newbie question: reduce/group_level</title>
<author><name>Paul Davis &lt;paul.joseph.davis@gmail.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/couchdb-user/200912.mbox/%3ce2111bbb0912052231h7e30c270vd185c64b3771f400@mail.gmail.com%3e"/>
<id>urn:uuid:%3ce2111bbb0912052231h7e30c270vd185c64b3771f400@mail-gmail-com%3e</id>
<updated>2009-12-06T06:31:33Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
On Sun, Dec 6, 2009 at 1:25 AM, Kamyar Navidan &lt;kamyar.n@gmail.com&gt; wrote:
&gt; Thank you for your response. So in general [x1, x2, ... , xn-1]
&gt; gets precedence over [x1, x2, ... , xn-1, xn] where x1...xn-1 is identical.
&gt; Am I getting this right?
&gt;

Yep. Shorter array sorts first if it's a prefix of a longer one.


</pre>
</div>
</content>
</entry>
<entry>
<title>Re: newbie question: reduce/group_level</title>
<author><name>Kamyar Navidan &lt;kamyar.n@gmail.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/couchdb-user/200912.mbox/%3c1df0d0a40912052225g16159c7fj720a30e2a1a2f4c3@mail.gmail.com%3e"/>
<id>urn:uuid:%3c1df0d0a40912052225g16159c7fj720a30e2a1a2f4c3@mail-gmail-com%3e</id>
<updated>2009-12-06T06:25:00Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Thank you for your response. So in general [x1, x2, ... , xn-1]
gets precedence over [x1, x2, ... , xn-1, xn] where x1...xn-1 is identical.
Am I getting this right?

On Sun, Dec 6, 2009 at 9:01 AM, Chris Anderson &lt;jchris@apache.org&gt; wrote:

&gt; On Sat, Dec 5, 2009 at 8:55 PM, Kamyar Navidan &lt;kamyar.n@gmail.com&gt; wrote:
&gt; &gt; Reading through Couchdb: The Definitive Guide I came across this section
&gt; in
&gt; &gt; chapter 06 :
&gt; &gt;
&gt; &gt; In the blog app, we use group_level reduce queries to compute the count
&gt; of
&gt; &gt;&gt; comments both on a per-post and total basis, achieved by querying the
&gt; same
&gt; &gt;&gt; view index with different methods. With some array keys, and assuming
&gt; each
&gt; &gt;&gt; key has the value 1:
&gt; &gt;
&gt; &gt;
&gt; &gt;&gt; ["a","b","c"]
&gt; &gt;
&gt; &gt; ["a","b","e"]
&gt; &gt;
&gt; &gt; ["a","c","m"]
&gt; &gt;
&gt; &gt; ["b","a","c"]
&gt; &gt;
&gt; &gt; ["b","a","g"]
&gt; &gt;
&gt; &gt;
&gt; &gt;&gt; The reduce view:
&gt; &gt;
&gt; &gt;
&gt; &gt;&gt; function(keys, values, rereduce) {
&gt; &gt;
&gt; &gt;  return sum(values)
&gt; &gt;
&gt; &gt; }
&gt; &gt;
&gt; &gt;
&gt; &gt;&gt; returns the total number of rows between the start and end key. So with
&gt; &gt;&gt; startkey=["a","b"]&amp;endkey=["b"] (which includes the first 3 of the above
&gt; &gt;&gt; keys) the result would equal 3.
&gt; &gt;
&gt; &gt;
&gt; &gt; Earlier in chapter it is stated that:
&gt; &gt;
&gt; &gt; The startkey and and endkey parameters specify an inclusive range on
&gt; which
&gt; &gt;&gt; we can search.
&gt; &gt;
&gt;
&gt; There is an inclusive_endkey=true http query parameter you can use.
&gt;
&gt; &gt;
&gt; &gt; So how come the fourth and fifth rows that satisfy endkey=["b"] condition
&gt; &gt; are not included in results? I guess I am missing something here. Can
&gt; &gt; somebody please clarify this for me.
&gt; &gt;
&gt;
&gt; In this case, only the keys:
&gt;
&gt; ["a","b","c"]
&gt; ["a","b","e"]
&gt; ["a","c","m"]
&gt;
&gt; are included in the range.
&gt;
&gt; the key ["b","a","c"] comes after ["b"] so it is not included. ["b"]
&gt; itself would match.
&gt;
&gt; Chris
&gt;
&gt;
&gt;
&gt;
&gt;
&gt; --
&gt; Chris Anderson
&gt; http://jchrisa.net
&gt; http://couch.io
&gt;


</pre>
</div>
</content>
</entry>
<entry>
<title>Re: newbie question: reduce/group_level</title>
<author><name>Chris Anderson &lt;jchris@apache.org&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/couchdb-user/200912.mbox/%3ce282921e0912052131u7e50e323nc9466663a7f7ae1b@mail.gmail.com%3e"/>
<id>urn:uuid:%3ce282921e0912052131u7e50e323nc9466663a7f7ae1b@mail-gmail-com%3e</id>
<updated>2009-12-06T05:31:24Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
On Sat, Dec 5, 2009 at 8:55 PM, Kamyar Navidan &lt;kamyar.n@gmail.com&gt; wrote:
&gt; Reading through Couchdb: The Definitive Guide I came across this section in
&gt; chapter 06 :
&gt;
&gt; In the blog app, we use group_level reduce queries to compute the count of
&gt;&gt; comments both on a per-post and total basis, achieved by querying the same
&gt;&gt; view index with different methods. With some array keys, and assuming each
&gt;&gt; key has the value 1:
&gt;
&gt;
&gt;&gt; ["a","b","c"]
&gt;
&gt; ["a","b","e"]
&gt;
&gt; ["a","c","m"]
&gt;
&gt; ["b","a","c"]
&gt;
&gt; ["b","a","g"]
&gt;
&gt;
&gt;&gt; The reduce view:
&gt;
&gt;
&gt;&gt; function(keys, values, rereduce) {
&gt;
&gt;  return sum(values)
&gt;
&gt; }
&gt;
&gt;
&gt;&gt; returns the total number of rows between the start and end key. So with
&gt;&gt; startkey=["a","b"]&amp;endkey=["b"] (which includes the first 3 of the above
&gt;&gt; keys) the result would equal 3.
&gt;
&gt;
&gt; Earlier in chapter it is stated that:
&gt;
&gt; The startkey and and endkey parameters specify an inclusive range on which
&gt;&gt; we can search.
&gt;

There is an inclusive_endkey=true http query parameter you can use.

&gt;
&gt; So how come the fourth and fifth rows that satisfy endkey=["b"] condition
&gt; are not included in results? I guess I am missing something here. Can
&gt; somebody please clarify this for me.
&gt;

In this case, only the keys:

["a","b","c"]
["a","b","e"]
["a","c","m"]

are included in the range.

the key ["b","a","c"] comes after ["b"] so it is not included. ["b"]
itself would match.

Chris





-- 
Chris Anderson
http://jchrisa.net
http://couch.io


</pre>
</div>
</content>
</entry>
<entry>
<title>newbie question: reduce/group_level</title>
<author><name>Kamyar Navidan &lt;kamyar.n@gmail.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/couchdb-user/200912.mbox/%3c1df0d0a40912052055s2b3d8983la2295a399a2b050a@mail.gmail.com%3e"/>
<id>urn:uuid:%3c1df0d0a40912052055s2b3d8983la2295a399a2b050a@mail-gmail-com%3e</id>
<updated>2009-12-06T04:55:19Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Reading through Couchdb: The Definitive Guide I came across this section in
chapter 06 :

In the blog app, we use group_level reduce queries to compute the count of
&gt; comments both on a per-post and total basis, achieved by querying the same
&gt; view index with different methods. With some array keys, and assuming each
&gt; key has the value 1:


&gt; ["a","b","c"]

["a","b","e"]

["a","c","m"]

["b","a","c"]

["b","a","g"]


&gt; The reduce view:


&gt; function(keys, values, rereduce) {

 return sum(values)

}


&gt; returns the total number of rows between the start and end key. So with
&gt; startkey=["a","b"]&amp;endkey=["b"] (which includes the first 3 of the above
&gt; keys) the result would equal 3.


Earlier in chapter it is stated that:

The startkey and and endkey parameters specify an inclusive range on which
&gt; we can search.


So how come the fourth and fifth rows that satisfy endkey=["b"] condition
are not included in results? I guess I am missing something here. Can
somebody please clarify this for me.


</pre>
</div>
</content>
</entry>
<entry>
<title>Re: CouchDB Returning Different Responses/Errors</title>
<author><name>Steve Anderson &lt;s.anderson.au@gmail.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/couchdb-user/200912.mbox/%3c811d598a0912051134h481a47cfh42b8e880f9293be5@mail.gmail.com%3e"/>
<id>urn:uuid:%3c811d598a0912051134h481a47cfh42b8e880f9293be5@mail-gmail-com%3e</id>
<updated>2009-12-05T19:34:04Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
May be CouchDBX didn't start properly the first time or something, as when I
closed it down and restarted it, its top two frames were displayed, when
previously they were blank (previously only the messages in the bottom pane
were displayed, there was no CouchDB logo, etc).

After that, everything worked fine (especially once I opened my eyes and saw
it was _all_dbs and not _all_dbs_).

Thanks for your help.


On Sun, Dec 6, 2009 at 5:50 AM, Chris Anderson &lt;jchris@apache.org&gt; wrote:

&gt; On Sat, Dec 5, 2009 at 2:48 AM, Steve Anderson &lt;s.anderson.au@gmail.com&gt;
&gt; wrote:
&gt; &gt; I am working my way through the online version of the O'Reilly book
&gt; &gt; "CouchDB: The Definitive Guide" by Anderson, Lehnardt and Slater.
&gt; &gt;
&gt; &gt; I am on Chapter 3 "Getting Started".  I've downloaded and started
&gt; CouchDBX,
&gt; &gt; but am getting errors, or at least different responses, when I run the
&gt; first
&gt; &gt; few commands in chapter 3.
&gt; &gt;
&gt; &gt; For example:
&gt; &gt;
&gt; &gt; silverlight:~ stevea$ curl http://127.0.0.1:5984/
&gt; &gt; {"couchdb":"Welcome","version":"0.10.0"}
&gt; &gt;
&gt; &gt; silverlight:~ stevea$ curl -X GET http://127.0.0.1:5984/_all_dbs_
&gt; &gt; {"error":"error","reason":"illegal_database_name"}
&gt;
&gt; this should be:
&gt;
&gt; curl -X GET http://127.0.0.1:5984/_all_dbs
&gt;
&gt; hopefully that will help.
&gt;
&gt;
&gt; &gt;
&gt; &gt; silverlight:~ stevea$ curl -X PUT http://127.0.0.1:5984/baseball
&gt; &gt; curl: (52) Empty reply from server
&gt; &gt;
&gt;
&gt; this should respond with {"ok":true}
&gt;
&gt; if it isn't than maybe there's a problem with your CouchDB. Have you
&gt; tried running the test suite from Firefox? It is available at
&gt; http://127.0.0.0:5984/_utils/couch_tests.html
&gt;
&gt; &gt; Any ideas?
&gt; &gt;
&gt; &gt; Thanks
&gt; &gt;
&gt;
&gt;
&gt;
&gt; --
&gt; Chris Anderson
&gt; http://jchrisa.net
&gt; http://couch.io
&gt;



-- 
www.submission.org


</pre>
</div>
</content>
</entry>
<entry>
<title>Re: Filtered Replication on 0.10 Roadmap</title>
<author><name>Chris Anderson &lt;jchris@apache.org&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/couchdb-user/200912.mbox/%3ce282921e0912051052i4e46123dufd5b30209cd5d2f7@mail.gmail.com%3e"/>
<id>urn:uuid:%3ce282921e0912051052i4e46123dufd5b30209cd5d2f7@mail-gmail-com%3e</id>
<updated>2009-12-05T18:52:29Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
On Sat, Dec 5, 2009 at 2:55 AM, Hatem Ben Yacoub &lt;hatemben@gmail.com&gt; wrote:
&gt; Someone can update the roadmap, or update me about filtered
&gt; replication, It's on the 0.10 roadmap, mentioned briefly in the
&gt; O'Reilly book, and we are at 0.10.1 and I can't find more details
&gt; about it.
&gt;

The current status is that there is an API for filtering the _changes
feed. The replicator in 0.10 consumes the changes feed, so the next
step is getting the replicator to use the filter API.

There is work in progress on this, so it should be fully ready to go in 0.11.

Chris

-- 
Chris Anderson
http://jchrisa.net
http://couch.io


</pre>
</div>
</content>
</entry>
<entry>
<title>Re: CouchDB Returning Different Responses/Errors</title>
<author><name>Chris Anderson &lt;jchris@apache.org&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/couchdb-user/200912.mbox/%3ce282921e0912051050w22b013e7v30d048c4aa2ef6f6@mail.gmail.com%3e"/>
<id>urn:uuid:%3ce282921e0912051050w22b013e7v30d048c4aa2ef6f6@mail-gmail-com%3e</id>
<updated>2009-12-05T18:50:29Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
On Sat, Dec 5, 2009 at 2:48 AM, Steve Anderson &lt;s.anderson.au@gmail.com&gt; wrote:
&gt; I am working my way through the online version of the O'Reilly book
&gt; "CouchDB: The Definitive Guide" by Anderson, Lehnardt and Slater.
&gt;
&gt; I am on Chapter 3 "Getting Started".  I've downloaded and started CouchDBX,
&gt; but am getting errors, or at least different responses, when I run the first
&gt; few commands in chapter 3.
&gt;
&gt; For example:
&gt;
&gt; silverlight:~ stevea$ curl http://127.0.0.1:5984/
&gt; {"couchdb":"Welcome","version":"0.10.0"}
&gt;
&gt; silverlight:~ stevea$ curl -X GET http://127.0.0.1:5984/_all_dbs_
&gt; {"error":"error","reason":"illegal_database_name"}

this should be:

curl -X GET http://127.0.0.1:5984/_all_dbs

hopefully that will help.


&gt;
&gt; silverlight:~ stevea$ curl -X PUT http://127.0.0.1:5984/baseball
&gt; curl: (52) Empty reply from server
&gt;

this should respond with {"ok":true}

if it isn't than maybe there's a problem with your CouchDB. Have you
tried running the test suite from Firefox? It is available at
http://127.0.0.0:5984/_utils/couch_tests.html

&gt; Any ideas?
&gt;
&gt; Thanks
&gt;



-- 
Chris Anderson
http://jchrisa.net
http://couch.io


</pre>
</div>
</content>
</entry>
<entry>
<title>Filtered Replication on 0.10 Roadmap</title>
<author><name>Hatem Ben Yacoub &lt;hatemben@gmail.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/couchdb-user/200912.mbox/%3c4b7381190912050255y475b659dh3073bcc8dba805fd@mail.gmail.com%3e"/>
<id>urn:uuid:%3c4b7381190912050255y475b659dh3073bcc8dba805fd@mail-gmail-com%3e</id>
<updated>2009-12-05T10:55:24Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Someone can update the roadmap, or update me about filtered
replication, It's on the 0.10 roadmap, mentioned briefly in the
O'Reilly book, and we are at 0.10.1 and I can't find more details
about it.

Thanks


</pre>
</div>
</content>
</entry>
<entry>
<title>CouchDB Returning Different Responses/Errors</title>
<author><name>Steve Anderson &lt;s.anderson.au@gmail.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/couchdb-user/200912.mbox/%3c811d598a0912050248q215cc878h1b08c2b38d73a775@mail.gmail.com%3e"/>
<id>urn:uuid:%3c811d598a0912050248q215cc878h1b08c2b38d73a775@mail-gmail-com%3e</id>
<updated>2009-12-05T10:48:44Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
I am working my way through the online version of the O'Reilly book
"CouchDB: The Definitive Guide" by Anderson, Lehnardt and Slater.

I am on Chapter 3 "Getting Started".  I've downloaded and started CouchDBX,
but am getting errors, or at least different responses, when I run the first
few commands in chapter 3.

For example:

silverlight:~ stevea$ curl http://127.0.0.1:5984/
{"couchdb":"Welcome","version":"0.10.0"}

silverlight:~ stevea$ curl -X GET http://127.0.0.1:5984/_all_dbs_
{"error":"error","reason":"illegal_database_name"}

silverlight:~ stevea$ curl -X PUT http://127.0.0.1:5984/baseball
curl: (52) Empty reply from server

Any ideas?

Thanks


</pre>
</div>
</content>
</entry>
<entry>
<title>Re: Javascript templating for shows/lists</title>
<author><name>Roger Binns &lt;rogerb@rogerbinns.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/couchdb-user/200912.mbox/%3c4B1A1CB7.3080609@rogerbinns.com%3e"/>
<id>urn:uuid:%3c4B1A1CB7-3080609@rogerbinns-com%3e</id>
<updated>2009-12-05T08:41:27Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Vlad GURDIGA wrote:
&gt; Did anyone try E4X?

I mention it in the wiki page in the first paragraph as useful for XML based
formats.  (The book also refers to using it for generating Atom).

http://wiki.apache.org/couchdb/Generating%20HTML%20from%20Javascript%20shows%20and%20lists

I've added Google's Closure to the list as it has an interesting approach of
ahead of time compilation to Javascript code.  (The goal isn't to list every
possible engine but rather a small handful that would be useful to the kind
of people consulting the wiki page for recommendations, and that are known
to work right now.)

Thanks to Nathan I found the attachment to EJS is because it also includes
helper functions that generate the HTML wrapping tags for you.  I've
mentioned that in the "Best Practises" section.  (Its code for doing this is
in a separate file confusing named views.js and can be used with the other
engines that do not do HTML escaping, with minor tweaking.)

I've tried to get EJS to work.  The exact same code and template applied on
a fresh Fedora 12 install results in a single space being returned (as
opposed to an regex error on Ubuntu 9.10).  Changing the template didn't
change what was returned. An older EJS version had the same regex error
problem on Ubuntu.

I've yet to hear from anyone what the bugs in Resig's micro-templating
actually are, other than the obvious one that it isn't supported and has no
way of reporting bugs!

Finally I think it is bad idea for the CouchDB book to be using Resig's
micro-templating.  (My being uncomfortable with it is why I started this
thread and wiki page.)  In addition to the claims of bugs and its lack of
support, not HTML escaping by default sets a bad precedent. Developers new
to CouchDB are likely to follow the book's example and then end up with HTML
output that is prone to XSS attacks or just plain invalid.  As CouchDB gets
more popular, I'd hate for there to be a perception that apps using it
generally tend to be broken or are good places to hunt for XSS attacks.

Roger
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAksaHLcACgkQmOOfHg372QSmuACg232OJt3gbnjQCj+UbpX5/D5J
R7IAn3uzNcsBhkcp1aT29v92CDQ5hOmC
=86F+
-----END PGP SIGNATURE-----


</pre>
</div>
</content>
</entry>
<entry>
<title>Re: Documents with many attachments</title>
<author><name>Dave Ray &lt;daveray@gmail.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/couchdb-user/200912.mbox/%3cbc3b092f0912041742h4094a5asf3e9b80b4810ef38@mail.gmail.com%3e"/>
<id>urn:uuid:%3cbc3b092f0912041742h4094a5asf3e9b80b4810ef38@mail-gmail-com%3e</id>
<updated>2009-12-05T01:42:59Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Thanks everybody for all the feedback. Having so many PNGs is, in
itself, a flaw in the current system so there's a good chance this may
just go away as we move forward. It's good to know about these
potential problems ahead of time though.

Dave

On Fri, Dec 4, 2009 at 4:34 AM, Paul Davis &lt;paul.joseph.davis@gmail.com&gt; wrote:
&gt;&gt;&gt; One of the CouchDB config files defines the maximum document size as 4GB.
&gt;&gt;&gt; Does that include attachments?
&gt;&gt;&gt;
&gt;&gt;
&gt;&gt; No, but it may include attachment stubs (although I'm guessing it doesn't).
&gt;&gt;
&gt;
&gt; That's the mochiweb request body size number isn't it? So it would be
&gt; "maximum size of any request to couchdb."
&gt;
&gt; Paul Davis
&gt;


</pre>
</div>
</content>
</entry>
<entry>
<title>Re: Javascript templating for shows/lists</title>
<author><name>Vlad GURDIGA &lt;gurdiga@gmail.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/couchdb-user/200912.mbox/%3cda7069940912041719x3a0450eek4e7d485b0ce4d298@mail.gmail.com%3e"/>
<id>urn:uuid:%3cda7069940912041719x3a0450eek4e7d485b0ce4d298@mail-gmail-com%3e</id>
<updated>2009-12-05T01:19:50Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Did anyone try E4X?

I'm not sure it counts here, but it is kinda working* for me so far...

* http://github.com/gurdiga/cozy

On Thu, Dec 3, 2009 at 11:13 PM, Roger Binns &lt;rogerb@rogerbinns.com&gt; wrote:
&gt; -----BEGIN PGP SIGNED MESSAGE-----
&gt; Hash: SHA1
&gt;
&gt; Can anyone recommend Javascript templating engines that can be used within
&gt; the CouchDB server side for implementing shows and lists? Â The Sofa weblog
&gt; app (also described in the book) uses a nice small one from John Resig.
&gt;
&gt; Book section:
&gt; Â http://books.couchdb.org/relax/design-documents/shows#Using%20Templates
&gt;
&gt; Engine:
&gt; Â http://ejohn.org/blog/javascript-micro-templating
&gt;
&gt; I am looking for something a little more complex such as handling
&gt; conditionals and automatically HTML escaping all values unless told
&gt; otherwise for specific ones (ie make XSS harder to happen accidentally).
&gt;
&gt; I can find several engines that will only run in the browser, or depend on a
&gt; DOM being present, or load the templates from a URL, or require a complete
&gt; HTML document to be present in the template (lists build row by row). Â These
&gt; are all deal breakers. Some are many kilobytes of code and require other
&gt; libraries such as jQuery. Â Will this much code be a problem for show/list usage?
&gt;
&gt; My plan is for the output to be somewhat plain but functional - ie usable on
&gt; a mobile phone. Â Then client side Javascript runs and adds functionality,
&gt; increases information detail, improves formatting etc. Â An example of this
&gt; in sofa is that the CouchDB side formatting provides dates in output which
&gt; client side Javascript then reformats and the client side also knows what
&gt; the local timezone is. Â Similarly client side javascript can add in icons,
&gt; previews of next items, tooltips etc. Â This all points to a simpler CouchDB
&gt; server side templating engine.
&gt;
&gt; I'll summarise responses in the wiki.
&gt;
&gt; Roger
&gt; -----BEGIN PGP SIGNATURE-----
&gt; Version: GnuPG v1.4.9 (GNU/Linux)
&gt; Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
&gt;
&gt; iEYEARECAAYFAksYKeIACgkQmOOfHg372QTh2ACeK4yirwjIqvlEaXx+ki6tegLM
&gt; /PcAn0SVnuFHFhkl0TWwUDYoWIXH6oAy
&gt; =jc5m
&gt; -----END PGP SIGNATURE-----
&gt;


</pre>
</div>
</content>
</entry>
<entry>
<title>Re: Javascript templating for shows/lists</title>
<author><name>Zachary Zolton &lt;zachary.zolton@gmail.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/couchdb-user/200912.mbox/%3cf728979f0912041421p8777b6bt906761f6eb65ec34@mail.gmail.com%3e"/>
<id>urn:uuid:%3cf728979f0912041421p8777b6bt906761f6eb65ec34@mail-gmail-com%3e</id>
<updated>2009-12-04T22:21:40Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Note that Rails has also changed to escaping by default:
http://weblog.rubyonrails.org/2009/10/12/what-s-new-in-edge-rails

On Fri, Dec 4, 2009 at 4:02 PM, Roger Binns &lt;rogerb@rogerbinns.com&gt; wrote:
&gt; -----BEGIN PGP SIGNED MESSAGE-----
&gt; Hash: SHA1
&gt;
&gt;&gt; http://github.com/yssk22/crayon
&gt;&gt;
&gt;&gt; This library enables you to write as followings:
&gt;&gt;
&gt;&gt; &lt;%= h(var) %&gt;
&gt;&gt; &lt;%= text_field(doc, "path-to-field") %&gt;
&gt;
&gt; embeddedjs includes a views.js file that adds something similar.
&gt;
&gt; My concern about escaping is over simple values.  For example if someone
&gt; specifies something like this in a template.
&gt;
&gt;   &lt;%= title %&gt;
&gt;
&gt; If the value is not HTML escaped by default then it is a potential source of
&gt; XSS attacks.  In the vast majority of cases values should be HTML escaped.
&gt; A separate mechanism can then be used to stop escaping (for example Mustache
&gt;  uses different tags and the Python Genshi templating system wraps the value
&gt; in a different class).
&gt;
&gt; Roger
&gt; -----BEGIN PGP SIGNATURE-----
&gt; Version: GnuPG v1.4.9 (GNU/Linux)
&gt; Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
&gt;
&gt; iEYEARECAAYFAksZhv4ACgkQmOOfHg372QSUVgCeNqUJn02nvDkmDElF0z6dOwix
&gt; kaUAoI1C3us4P07CuBAy//OLa/pmI4pt
&gt; =72DE
&gt; -----END PGP SIGNATURE-----
&gt;


</pre>
</div>
</content>
</entry>
<entry>
<title>Re: Javascript templating for shows/lists</title>
<author><name>Roger Binns &lt;rogerb@rogerbinns.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/couchdb-user/200912.mbox/%3c4B1986FE.2060307@rogerbinns.com%3e"/>
<id>urn:uuid:%3c4B1986FE-2060307@rogerbinns-com%3e</id>
<updated>2009-12-04T22:02:38Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

&gt; http://github.com/yssk22/crayon
&gt; 
&gt; This library enables you to write as followings:
&gt; 
&gt; &lt;%= h(var) %&gt;
&gt; &lt;%= text_field(doc, "path-to-field") %&gt;

embeddedjs includes a views.js file that adds something similar.

My concern about escaping is over simple values.  For example if someone
specifies something like this in a template.

   &lt;%= title %&gt;

If the value is not HTML escaped by default then it is a potential source of
XSS attacks.  In the vast majority of cases values should be HTML escaped.
A separate mechanism can then be used to stop escaping (for example Mustache
 uses different tags and the Python Genshi templating system wraps the value
in a different class).

Roger
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAksZhv4ACgkQmOOfHg372QSUVgCeNqUJn02nvDkmDElF0z6dOwix
kaUAoI1C3us4P07CuBAy//OLa/pmI4pt
=72DE
-----END PGP SIGNATURE-----


</pre>
</div>
</content>
</entry>
<entry>
<title>Re: Javascript templating for shows/lists</title>
<author><name>Roger Binns &lt;rogerb@rogerbinns.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/couchdb-user/200912.mbox/%3c4B198463.4030307@rogerbinns.com%3e"/>
<id>urn:uuid:%3c4B198463-4030307@rogerbinns-com%3e</id>
<updated>2009-12-04T21:51:31Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Benoit Chesneau wrote:
&gt; Well json resig code is buggy and give less features than embededjs.

What are the bugs in the Resig implementation?  (I'll mention them in the
wiki.)  Your comment also highlights the biggest problem with it - there is
no bug tracker or development/test/release process behind it, as it is more
a proof of concept.

&gt; Anyway if you  don't want logic in templates 

I'm averse to having Javascript in the templates.  You can see the evolution
of templating in other scripting languages.

&gt; maybe underscore 

Underscore is in the same family as Resig and embeddedjs - Javascript code
in the markup.

&gt; though I really don't like having things starting
&gt; with a "_" which is against some common usages.

I guess we have JQuery to blame for popularising the punctuation character
approach

&gt; Also have a look on closure which may be interesting too.

- From reading the docs it looks like it should work.  Having a compilation to
Javascript is nice for debugging since you'll find out about syntax errors
at compile time rather than run time.  I'll add this one to the wiki once I
get time to install Java etc.

Roger
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAksZhF8ACgkQmOOfHg372QT0cACfSXeQNvEaEUWAw3thyZbDT+ur
ZGgAnjpYiIxOaEVlW6RJ04bwpQvxgRRu
=Muw5
-----END PGP SIGNATURE-----


</pre>
</div>
</content>
</entry>
<entry>
<title>CouchDB Filtered Replication</title>
<author><name>Hatem Ben Yacoub &lt;hatemben@gmail.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/couchdb-user/200912.mbox/%3c4b7381190912041029n4f2d7ff7qc460b5873c02d9dd@mail.gmail.com%3e"/>
<id>urn:uuid:%3c4b7381190912041029n4f2d7ff7qc460b5873c02d9dd@mail-gmail-com%3e</id>
<updated>2009-12-04T18:29:10Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Hi all,

someone can update the roadmap, or update me about filtered
replication, It's on the 0.10 roadmap, mentioned briefly in the book,
and we are at 0.10.1 and I can't find more details.

Thanks

--
Eng. Hatem Ben Yacoub
Senior Systems Architect &amp; IT Consultant
http://hatem.tel


</pre>
</div>
</content>
</entry>
<entry>
<title>Re: Get Document Size</title>
<author><name>Sebastian Cohnen &lt;sebastiancohnen@googlemail.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/couchdb-user/200912.mbox/%3cA82BC5A1-D847-4507-A51F-8CF7B32813A4@googlemail.com%3e"/>
<id>urn:uuid:%3cA82BC5A1-D847-4507-A51F-8CF7B32813A4@googlemail-com%3e</id>
<updated>2009-12-04T16:11:36Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
yeah, this looks better :)

On 04.12.2009, at 17:08, Zachary Zolton wrote:

&gt; This seems to work for attachments:
&gt; 
&gt; function(doc) {
&gt;  if (doc['_attachments']) {
&gt;    var attachementSize = 0;
&gt;    for each (var stub in doc['_attachments']) {
&gt;      attachementSize += stub.length;
&gt;    }
&gt;    emit(null, attachementSize);
&gt;  }
&gt; }
&gt; 
&gt; 
&gt; On Fri, Dec 4, 2009 at 9:46 AM, Sebastian Cohnen
&gt; &lt;sebastiancohnen@googlemail.com&gt; wrote:
&gt;&gt; this still does not include the documents attachments...
&gt;&gt; 
&gt;&gt; On 04.12.2009, at 16:33, Zachary Zolton wrote:
&gt;&gt; 
&gt;&gt;&gt; You mean something like this map function?
&gt;&gt;&gt; 
&gt;&gt;&gt; function(doc) {
&gt;&gt;&gt;  function toJson() {
&gt;&gt;&gt;    // code...
&gt;&gt;&gt;  }
&gt;&gt;&gt; 
&gt;&gt;&gt;  emit(doc.someAttr, length(toJson(doc)));
&gt;&gt;&gt; }
&gt;&gt;&gt; 
&gt;&gt;&gt; 
&gt;&gt;&gt; On Fri, Dec 4, 2009 at 3:46 AM, Andreas Pavlogiannis
&gt;&gt;&gt; &lt;paulogiann.couchdb@gmail.com&gt; wrote:
&gt;&gt;&gt;&gt; That might work for a single document, but I  'd rather calculate the size
&gt;&gt;&gt;&gt; inside a map function so that I can then use a reduce to sum up.
&gt;&gt;&gt;&gt; 
&gt;&gt;&gt;&gt; 2009/12/4 Sebastian Cohnen &lt;sebastiancohnen@googlemail.com&gt;
&gt;&gt;&gt;&gt; 
&gt;&gt;&gt;&gt;&gt; what about doing a HEAD request and look for Content-Length?
&gt;&gt;&gt;&gt;&gt; 
&gt;&gt;&gt;&gt;&gt; {~} I curl -I http://localhost:5984/test/DOCUMENT-ID
&gt;&gt;&gt;&gt;&gt; HTTP/1.1 &lt;http://localhost:5984/test/DOCUMENT-ID%0AHTTP/1.1&gt; 200
OK
&gt;&gt;&gt;&gt;&gt; Server: CouchDB/0.11.0b60a6b3e7-git (Erlang OTP/R13B)
&gt;&gt;&gt;&gt;&gt; Etag: "1-1a6c2a80b8615b2399ff5ba66d18534d"
&gt;&gt;&gt;&gt;&gt; Date: Fri, 04 Dec 2009 09:38:34 GMT
&gt;&gt;&gt;&gt;&gt; Content-Type: text/plain;charset=utf-8
&gt;&gt;&gt;&gt;&gt; Content-Length: 169
&gt;&gt;&gt;&gt;&gt; Cache-Control: must-revalidate
&gt;&gt;&gt;&gt;&gt; 
&gt;&gt;&gt;&gt;&gt; 
&gt;&gt;&gt;&gt;&gt; On 04.12.2009, at 10:17, Andreas Pavlogiannis wrote:
&gt;&gt;&gt;&gt;&gt; 
&gt;&gt;&gt;&gt;&gt;&gt; Hello,
&gt;&gt;&gt;&gt;&gt;&gt; 
&gt;&gt;&gt;&gt;&gt;&gt; Is there a uniform way to obtain a document's size (attachments'
size
&gt;&gt;&gt;&gt;&gt; included) ?
&gt;&gt;&gt;&gt;&gt;&gt; 
&gt;&gt;&gt;&gt;&gt;&gt; Thanks, Andreas
&gt;&gt;&gt;&gt;&gt; 
&gt;&gt;&gt;&gt;&gt; 
&gt;&gt;&gt;&gt; 
&gt;&gt; 
&gt;&gt; 



</pre>
</div>
</content>
</entry>
<entry>
<title>Re: Get Document Size</title>
<author><name>Zachary Zolton &lt;zachary.zolton@gmail.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/couchdb-user/200912.mbox/%3cf728979f0912040808o3538f16esdb2af160b6a440bb@mail.gmail.com%3e"/>
<id>urn:uuid:%3cf728979f0912040808o3538f16esdb2af160b6a440bb@mail-gmail-com%3e</id>
<updated>2009-12-04T16:08:25Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
This seems to work for attachments:

function(doc) {
  if (doc['_attachments']) {
    var attachementSize = 0;
    for each (var stub in doc['_attachments']) {
      attachementSize += stub.length;
    }
    emit(null, attachementSize);
  }
}


On Fri, Dec 4, 2009 at 9:46 AM, Sebastian Cohnen
&lt;sebastiancohnen@googlemail.com&gt; wrote:
&gt; this still does not include the documents attachments...
&gt;
&gt; On 04.12.2009, at 16:33, Zachary Zolton wrote:
&gt;
&gt;&gt; You mean something like this map function?
&gt;&gt;
&gt;&gt; function(doc) {
&gt;&gt;  function toJson() {
&gt;&gt;    // code...
&gt;&gt;  }
&gt;&gt;
&gt;&gt;  emit(doc.someAttr, length(toJson(doc)));
&gt;&gt; }
&gt;&gt;
&gt;&gt;
&gt;&gt; On Fri, Dec 4, 2009 at 3:46 AM, Andreas Pavlogiannis
&gt;&gt; &lt;paulogiann.couchdb@gmail.com&gt; wrote:
&gt;&gt;&gt; That might work for a single document, but I  'd rather calculate the size
&gt;&gt;&gt; inside a map function so that I can then use a reduce to sum up.
&gt;&gt;&gt;
&gt;&gt;&gt; 2009/12/4 Sebastian Cohnen &lt;sebastiancohnen@googlemail.com&gt;
&gt;&gt;&gt;
&gt;&gt;&gt;&gt; what about doing a HEAD request and look for Content-Length?
&gt;&gt;&gt;&gt;
&gt;&gt;&gt;&gt; {~} I curl -I http://localhost:5984/test/DOCUMENT-ID
&gt;&gt;&gt;&gt; HTTP/1.1 &lt;http://localhost:5984/test/DOCUMENT-ID%0AHTTP/1.1&gt; 200 OK
&gt;&gt;&gt;&gt; Server: CouchDB/0.11.0b60a6b3e7-git (Erlang OTP/R13B)
&gt;&gt;&gt;&gt; Etag: "1-1a6c2a80b8615b2399ff5ba66d18534d"
&gt;&gt;&gt;&gt; Date: Fri, 04 Dec 2009 09:38:34 GMT
&gt;&gt;&gt;&gt; Content-Type: text/plain;charset=utf-8
&gt;&gt;&gt;&gt; Content-Length: 169
&gt;&gt;&gt;&gt; Cache-Control: must-revalidate
&gt;&gt;&gt;&gt;
&gt;&gt;&gt;&gt;
&gt;&gt;&gt;&gt; On 04.12.2009, at 10:17, Andreas Pavlogiannis wrote:
&gt;&gt;&gt;&gt;
&gt;&gt;&gt;&gt;&gt; Hello,
&gt;&gt;&gt;&gt;&gt;
&gt;&gt;&gt;&gt;&gt; Is there a uniform way to obtain a document's size (attachments' size
&gt;&gt;&gt;&gt; included) ?
&gt;&gt;&gt;&gt;&gt;
&gt;&gt;&gt;&gt;&gt; Thanks, Andreas
&gt;&gt;&gt;&gt;
&gt;&gt;&gt;&gt;
&gt;&gt;&gt;
&gt;
&gt;


</pre>
</div>
</content>
</entry>
<entry>
<title>Re: Get Document Size</title>
<author><name>Sebastian Cohnen &lt;sebastiancohnen@googlemail.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/couchdb-user/200912.mbox/%3cAF692976-FEBB-4CB1-9385-3B5F2865DA9B@googlemail.com%3e"/>
<id>urn:uuid:%3cAF692976-FEBB-4CB1-9385-3B5F2865DA9B@googlemail-com%3e</id>
<updated>2009-12-04T15:46:00Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
this still does not include the documents attachments...

On 04.12.2009, at 16:33, Zachary Zolton wrote:

&gt; You mean something like this map function?
&gt; 
&gt; function(doc) {
&gt;  function toJson() {
&gt;    // code...
&gt;  }
&gt; 
&gt;  emit(doc.someAttr, length(toJson(doc)));
&gt; }
&gt; 
&gt; 
&gt; On Fri, Dec 4, 2009 at 3:46 AM, Andreas Pavlogiannis
&gt; &lt;paulogiann.couchdb@gmail.com&gt; wrote:
&gt;&gt; That might work for a single document, but I  'd rather calculate the size
&gt;&gt; inside a map function so that I can then use a reduce to sum up.
&gt;&gt; 
&gt;&gt; 2009/12/4 Sebastian Cohnen &lt;sebastiancohnen@googlemail.com&gt;
&gt;&gt; 
&gt;&gt;&gt; what about doing a HEAD request and look for Content-Length?
&gt;&gt;&gt; 
&gt;&gt;&gt; {~} I curl -I http://localhost:5984/test/DOCUMENT-ID
&gt;&gt;&gt; HTTP/1.1 &lt;http://localhost:5984/test/DOCUMENT-ID%0AHTTP/1.1&gt; 200 OK
&gt;&gt;&gt; Server: CouchDB/0.11.0b60a6b3e7-git (Erlang OTP/R13B)
&gt;&gt;&gt; Etag: "1-1a6c2a80b8615b2399ff5ba66d18534d"
&gt;&gt;&gt; Date: Fri, 04 Dec 2009 09:38:34 GMT
&gt;&gt;&gt; Content-Type: text/plain;charset=utf-8
&gt;&gt;&gt; Content-Length: 169
&gt;&gt;&gt; Cache-Control: must-revalidate
&gt;&gt;&gt; 
&gt;&gt;&gt; 
&gt;&gt;&gt; On 04.12.2009, at 10:17, Andreas Pavlogiannis wrote:
&gt;&gt;&gt; 
&gt;&gt;&gt;&gt; Hello,
&gt;&gt;&gt;&gt; 
&gt;&gt;&gt;&gt; Is there a uniform way to obtain a document's size (attachments' size
&gt;&gt;&gt; included) ?
&gt;&gt;&gt;&gt; 
&gt;&gt;&gt;&gt; Thanks, Andreas
&gt;&gt;&gt; 
&gt;&gt;&gt; 
&gt;&gt; 



</pre>
</div>
</content>
</entry>
<entry>
<title>Re: Get Document Size</title>
<author><name>Zachary Zolton &lt;zachary.zolton@gmail.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/couchdb-user/200912.mbox/%3cf728979f0912040733v5d7499cdl46de2e39e0305330@mail.gmail.com%3e"/>
<id>urn:uuid:%3cf728979f0912040733v5d7499cdl46de2e39e0305330@mail-gmail-com%3e</id>
<updated>2009-12-04T15:33:13Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
You mean something like this map function?

function(doc) {
  function toJson() {
    // code...
  }

  emit(doc.someAttr, length(toJson(doc)));
}


On Fri, Dec 4, 2009 at 3:46 AM, Andreas Pavlogiannis
&lt;paulogiann.couchdb@gmail.com&gt; wrote:
&gt; That might work for a single document, but I  'd rather calculate the size
&gt; inside a map function so that I can then use a reduce to sum up.
&gt;
&gt; 2009/12/4 Sebastian Cohnen &lt;sebastiancohnen@googlemail.com&gt;
&gt;
&gt;&gt; what about doing a HEAD request and look for Content-Length?
&gt;&gt;
&gt;&gt; {~} I curl -I http://localhost:5984/test/DOCUMENT-ID
&gt;&gt; HTTP/1.1 &lt;http://localhost:5984/test/DOCUMENT-ID%0AHTTP/1.1&gt; 200 OK
&gt;&gt; Server: CouchDB/0.11.0b60a6b3e7-git (Erlang OTP/R13B)
&gt;&gt; Etag: "1-1a6c2a80b8615b2399ff5ba66d18534d"
&gt;&gt; Date: Fri, 04 Dec 2009 09:38:34 GMT
&gt;&gt; Content-Type: text/plain;charset=utf-8
&gt;&gt; Content-Length: 169
&gt;&gt; Cache-Control: must-revalidate
&gt;&gt;
&gt;&gt;
&gt;&gt; On 04.12.2009, at 10:17, Andreas Pavlogiannis wrote:
&gt;&gt;
&gt;&gt; &gt; Hello,
&gt;&gt; &gt;
&gt;&gt; &gt; Is there a uniform way to obtain a document's size (attachments' size
&gt;&gt; included) ?
&gt;&gt; &gt;
&gt;&gt; &gt; Thanks, Andreas
&gt;&gt;
&gt;&gt;
&gt;


</pre>
</div>
</content>
</entry>
<entry>
<title>Re: Javascript templating for shows/lists</title>
<author><name>Nathan Stott &lt;nrstott@gmail.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/couchdb-user/200912.mbox/%3cea28b75b0912040652w1a7804buebe3a1c4632c9e0b@mail.gmail.com%3e"/>
<id>urn:uuid:%3cea28b75b0912040652w1a7804buebe3a1c4632c9e0b@mail-gmail-com%3e</id>
<updated>2009-12-04T14:52:10Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
I second what Benoit said.  EJS works great.  I use it a lot.  It does way
more than Resig's simple templating.

On Fri, Dec 4, 2009 at 8:38 AM, Yohei Sasaki &lt;yssk22@gmail.com&gt; wrote:

&gt; Hi,
&gt;
&gt; I'm from Rails to Couch. I use embeddedjs, too, because it is similar to
&gt; ERB.
&gt;
&gt; &gt;Also no idea if it does html escaping of values - examining
&gt; &gt;code leads me to believe it does not.
&gt;
&gt; I think so, and I started to develop the library like ActionView.
&gt; http://github.com/yssk22/crayon
&gt;
&gt; This library enables you to write as followings:
&gt;
&gt; &lt;%= h(var) %&gt;
&gt; &lt;%= text_field(doc, "path-to-field") %&gt;
&gt;
&gt; Thanks.
&gt;
&gt; --
&gt; Yohei Sasaki
&gt; http://www.yssk22.info/
&gt;
&gt; On 2009/12/04, at 17:30, Roger Binns wrote:
&gt;
&gt; &gt; -----BEGIN PGP SIGNED MESSAGE-----
&gt; &gt; Hash: SHA1
&gt; &gt;
&gt; &gt; Benoit Chesneau wrote:
&gt; &gt;&gt; embeddedjs works well here... which crash did you have ?
&gt; &gt;
&gt; &gt; It is probably versioning or something.  The error text is:
&gt; &gt;
&gt; &gt;  JavaScript function raised error: TypeError: regex.exec is not a
&gt; function
&gt; &gt;
&gt; &gt; I'm using CouchDB 0.10.0 on Ubuntu 9.10.  Embeddedjs doesn't look too
&gt; &gt; promising anyway.  It is just Javascript embedded in text, but John
&gt; Resig's
&gt; &gt; code can do that too (and with way less code).  I do like the error
&gt; &gt; reporting (line number and details) although that seems unlikely to work
&gt; &gt; server side.  Also no idea if it does html escaping of values - examining
&gt; &gt; code leads me to believe it does not.
&gt; &gt;
&gt; &gt; Roger
&gt; &gt; -----BEGIN PGP SIGNATURE-----
&gt; &gt; Version: GnuPG v1.4.9 (GNU/Linux)
&gt; &gt; Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
&gt; &gt;
&gt; &gt; iEYEARECAAYFAksYyK0ACgkQmOOfHg372QQ82gCgr/9Gol0FLyDDGRcHyJW9qvjV
&gt; &gt; zcUAn3kvWoBf9nc+E0TJLmyJUP95LcCo
&gt; &gt; =/lQ6
&gt; &gt; -----END PGP SIGNATURE-----
&gt;
&gt;


</pre>
</div>
</content>
</entry>
<entry>
<title>Re: Javascript templating for shows/lists</title>
<author><name>Yohei Sasaki &lt;yssk22@gmail.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/couchdb-user/200912.mbox/%3c7F739197-9056-43DD-AE3F-828412F7F4CC@webjourney.org%3e"/>
<id>urn:uuid:%3c7F739197-9056-43DD-AE3F-828412F7F4CC@webjourney-org%3e</id>
<updated>2009-12-04T14:38:32Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Hi,

I'm from Rails to Couch. I use embeddedjs, too, because it is similar to ERB.

&gt;Also no idea if it does html escaping of values - examining
&gt;code leads me to believe it does not.

I think so, and I started to develop the library like ActionView.
http://github.com/yssk22/crayon

This library enables you to write as followings:

&lt;%= h(var) %&gt;
&lt;%= text_field(doc, "path-to-field") %&gt;

Thanks.

--
Yohei Sasaki
http://www.yssk22.info/

On 2009/12/04, at 17:30, Roger Binns wrote:

&gt; -----BEGIN PGP SIGNED MESSAGE-----
&gt; Hash: SHA1
&gt; 
&gt; Benoit Chesneau wrote:
&gt;&gt; embeddedjs works well here... which crash did you have ?
&gt; 
&gt; It is probably versioning or something.  The error text is:
&gt; 
&gt;  JavaScript function raised error: TypeError: regex.exec is not a function
&gt; 
&gt; I'm using CouchDB 0.10.0 on Ubuntu 9.10.  Embeddedjs doesn't look too
&gt; promising anyway.  It is just Javascript embedded in text, but John Resig's
&gt; code can do that too (and with way less code).  I do like the error
&gt; reporting (line number and details) although that seems unlikely to work
&gt; server side.  Also no idea if it does html escaping of values - examining
&gt; code leads me to believe it does not.
&gt; 
&gt; Roger
&gt; -----BEGIN PGP SIGNATURE-----
&gt; Version: GnuPG v1.4.9 (GNU/Linux)
&gt; Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
&gt; 
&gt; iEYEARECAAYFAksYyK0ACgkQmOOfHg372QQ82gCgr/9Gol0FLyDDGRcHyJW9qvjV
&gt; zcUAn3kvWoBf9nc+E0TJLmyJUP95LcCo
&gt; =/lQ6
&gt; -----END PGP SIGNATURE-----



</pre>
</div>
</content>
</entry>
<entry>
<title>Re: Error compacting a database on Windows</title>
<author><name>Paul Davis &lt;paul.joseph.davis@gmail.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/couchdb-user/200912.mbox/%3ce2111bbb0912040435p53241c4ci62d4d593c3a291c4@mail.gmail.com%3e"/>
<id>urn:uuid:%3ce2111bbb0912040435p53241c4ci62d4d593c3a291c4@mail-gmail-com%3e</id>
<updated>2009-12-04T12:35:37Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
On Fri, Dec 4, 2009 at 7:29 AM, ujay68 &lt;ujay68@gmail.com&gt; wrote:
&gt; Thanks for answering. I now found this issue which looks like the same topic:
&gt;
&gt; https://issues.apache.org/jira/browse/COUCHDB-86
&gt;
&gt; Any chance of re-opening that one? Not having compaction would make
&gt; CouchDB essentially unavailable on Windows, which would be very
&gt; unfortunate ideed. (I'm 100% pro Linux, but many customers and project
&gt; managers aren't, and convincing them of switching to a NoSQL solution
&gt; will be tricky enough even without convincing them to leave Windows at
&gt; the same time ... ;-)
&gt;
&gt; Jay
&gt;

The proper fix to this is probably going to be intertwined with [1].
Its not a trivial change so its going to require someone to step up
and figure out that code.

Paul Davis

[1] https://issues.apache.org/jira/browse/COUCHDB-67


</pre>
</div>
</content>
</entry>
<entry>
<title>Re: Error compacting a database on Windows</title>
<author><name>ujay68 &lt;ujay68@gmail.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/couchdb-user/200912.mbox/%3c883288400912040429q2cdee57q4aadb721f41ffbc9@mail.gmail.com%3e"/>
<id>urn:uuid:%3c883288400912040429q2cdee57q4aadb721f41ffbc9@mail-gmail-com%3e</id>
<updated>2009-12-04T12:29:58Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Thanks for answering. I now found this issue which looks like the same topic:

https://issues.apache.org/jira/browse/COUCHDB-86

Any chance of re-opening that one? Not having compaction would make
CouchDB essentially unavailable on Windows, which would be very
unfortunate ideed. (I'm 100% pro Linux, but many customers and project
managers aren't, and convincing them of switching to a NoSQL solution
will be tricky enough even without convincing them to leave Windows at
the same time ... ;-)

Jay


</pre>
</div>
</content>
</entry>
<entry>
<title>Re: Problem with NFS storage</title>
<author><name>Paul Davis &lt;paul.joseph.davis@gmail.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/couchdb-user/200912.mbox/%3ce2111bbb0912040348kfbbb5e5pe4206ef65dbb636e@mail.gmail.com%3e"/>
<id>urn:uuid:%3ce2111bbb0912040348kfbbb5e5pe4206ef65dbb636e@mail-gmail-com%3e</id>
<updated>2009-12-04T11:48:14Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
On Fri, Dec 4, 2009 at 6:01 AM, Nils Breunese &lt;N.Breunese@vpro.nl&gt; wrote:
&gt; Hello,
&gt;
&gt; We are currently running CouchDB 0.9.1. We would like to upgrade to version
&gt; 0.10 for its JSONP support, but our hosting provider was having problems
&gt; getting the testsuite to pass, so we haven't upgraded our production setup
&gt; yet. On our test servers 0.10 is working fine and passing all tests.
&gt;
&gt; Now our hosting provider claims to have found the problem. Translated from
&gt; Dutch their report comes down to something like this:
&gt;
&gt; ----
&gt; CouchDB can't handle having its data directory on NFS.
&gt;
&gt; It seems CouchDB tries to do this:
&gt; 1 mkdir test
&gt; 2 start process X with fd under test/foo
&gt; 3 do the work
&gt; 4 rm test/foo
&gt; 5 rmdir test
&gt; 6 kill process X
&gt;
&gt; When test/ is on NFS:
&gt; In step 4 an open file is being removed. NFS doesn't really support this and
&gt; the workaround is that the client implementation does
&gt;  mv file .nfsXXXXXXX
&gt;
&gt; However, the 'rmdir test' in step 5 then cannot succeed anymore, since the
&gt; directory is not empty. This eventually causes CouchDB to crash.
&gt;
&gt; In earlier versions of CouchDB the open/rm/rmdir/kill order may have been
&gt; different, for instance open/rm/kill/rmdir.
&gt; ----
&gt;
&gt; Could this indeed be the problem? Should I file a Jira ticket on this? For
&gt; now we might have to ask them to change to local storage?
&gt;
&gt; Nils Breunese.
&gt;

I'm not overly familiar with the file handling semantics of NFS other
than I know it does weird things like you mention. It does sound like
the hosting provider has narrowed it down to the way we do the unix
style unlink rename semantics. Its still early so I could be missing
an easy answer.

It is a bit odd that the upgrade to 0.10.x started causing this
though. I don't remember anything in that part of the code changing.

There have been a couple proposals on changing some of the file
handling semantics to support windows as well as remove the
restrictions on database names. Perhaps if someone gets motivated to
add that this would go away.

HTH,
Paul Davis


</pre>
</div>
</content>
</entry>
<entry>
<title>Problem with NFS storage</title>
<author><name>Nils Breunese &lt;N.Breunese@vpro.nl&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/couchdb-user/200912.mbox/%3c4B18EC1E.1080909@vpro.nl%3e"/>
<id>urn:uuid:%3c4B18EC1E-1080909@vpro-nl%3e</id>
<updated>2009-12-04T11:01:50Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Hello,

We are currently running CouchDB 0.9.1. We would like to upgrade to 
version 0.10 for its JSONP support, but our hosting provider was having 
problems getting the testsuite to pass, so we haven't upgraded our 
production setup yet. On our test servers 0.10 is working fine and 
passing all tests.

Now our hosting provider claims to have found the problem. Translated 
from Dutch their report comes down to something like this:

----
CouchDB can't handle having its data directory on NFS.

It seems CouchDB tries to do this:
1 mkdir test
2 start process X with fd under test/foo
3 do the work
4 rm test/foo
5 rmdir test
6 kill process X

When test/ is on NFS:
In step 4 an open file is being removed. NFS doesn't really support this 
and the workaround is that the client implementation does
   mv file .nfsXXXXXXX

However, the 'rmdir test' in step 5 then cannot succeed anymore, since 
the directory is not empty. This eventually causes CouchDB to crash.

In earlier versions of CouchDB the open/rm/rmdir/kill order may have 
been different, for instance open/rm/kill/rmdir.
----

Could this indeed be the problem? Should I file a Jira ticket on this? 
For now we might have to ask them to change to local storage?

Nils Breunese.


</pre>
</div>
</content>
</entry>
<entry>
<title>Re: Get Document Size</title>
<author><name>Andreas Pavlogiannis &lt;paulogiann.couchdb@gmail.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/couchdb-user/200912.mbox/%3c3a3e8270912040146u4ce88db8xbda3299dca3ead8d@mail.gmail.com%3e"/>
<id>urn:uuid:%3c3a3e8270912040146u4ce88db8xbda3299dca3ead8d@mail-gmail-com%3e</id>
<updated>2009-12-04T09:46:26Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
That might work for a single document, but I  'd rather calculate the size
inside a map function so that I can then use a reduce to sum up.

2009/12/4 Sebastian Cohnen &lt;sebastiancohnen@googlemail.com&gt;

&gt; what about doing a HEAD request and look for Content-Length?
&gt;
&gt; {~} I curl -I http://localhost:5984/test/DOCUMENT-ID
&gt; HTTP/1.1 &lt;http://localhost:5984/test/DOCUMENT-ID%0AHTTP/1.1&gt; 200 OK
&gt; Server: CouchDB/0.11.0b60a6b3e7-git (Erlang OTP/R13B)
&gt; Etag: "1-1a6c2a80b8615b2399ff5ba66d18534d"
&gt; Date: Fri, 04 Dec 2009 09:38:34 GMT
&gt; Content-Type: text/plain;charset=utf-8
&gt; Content-Length: 169
&gt; Cache-Control: must-revalidate
&gt;
&gt;
&gt; On 04.12.2009, at 10:17, Andreas Pavlogiannis wrote:
&gt;
&gt; &gt; Hello,
&gt; &gt;
&gt; &gt; Is there a uniform way to obtain a document's size (attachments' size
&gt; included) ?
&gt; &gt;
&gt; &gt; Thanks, Andreas
&gt;
&gt;


</pre>
</div>
</content>
</entry>
<entry>
<title>Re: Get Document Size</title>
<author><name>Sebastian Cohnen &lt;sebastiancohnen@googlemail.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/couchdb-user/200912.mbox/%3cFD056E6D-C4AE-403E-BD79-98C2F36E8356@googlemail.com%3e"/>
<id>urn:uuid:%3cFD056E6D-C4AE-403E-BD79-98C2F36E8356@googlemail-com%3e</id>
<updated>2009-12-04T09:39:19Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
what about doing a HEAD request and look for Content-Length? 

{~} I curl -I http://localhost:5984/test/DOCUMENT-ID
HTTP/1.1 200 OK
Server: CouchDB/0.11.0b60a6b3e7-git (Erlang OTP/R13B)
Etag: "1-1a6c2a80b8615b2399ff5ba66d18534d"
Date: Fri, 04 Dec 2009 09:38:34 GMT
Content-Type: text/plain;charset=utf-8
Content-Length: 169
Cache-Control: must-revalidate


On 04.12.2009, at 10:17, Andreas Pavlogiannis wrote:

&gt; Hello,
&gt; 
&gt; Is there a uniform way to obtain a document's size (attachments' size included) ?
&gt; 
&gt; Thanks, Andreas



</pre>
</div>
</content>
</entry>
<entry>
<title>Re: Documents with many attachments</title>
<author><name>Paul Davis &lt;paul.joseph.davis@gmail.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/couchdb-user/200912.mbox/%3ce2111bbb0912040134h297681ebi800a2437ffc811ef@mail.gmail.com%3e"/>
<id>urn:uuid:%3ce2111bbb0912040134h297681ebi800a2437ffc811ef@mail-gmail-com%3e</id>
<updated>2009-12-04T09:34:41Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
&gt;&gt; One of the CouchDB config files defines the maximum document size as 4GB.
&gt;&gt; Does that include attachments?
&gt;&gt;
&gt;
&gt; No, but it may include attachment stubs (although I'm guessing it doesn't).
&gt;

That's the mochiweb request body size number isn't it? So it would be
"maximum size of any request to couchdb."

Paul Davis


</pre>
</div>
</content>
</entry>
</feed>
