From user-return-8245-apmail-couchdb-user-archive=couchdb.apache.org@couchdb.apache.org Sun Jan 03 21:46:18 2010 Return-Path: Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: (qmail 38433 invoked from network); 3 Jan 2010 21:46:17 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 3 Jan 2010 21:46:17 -0000 Received: (qmail 82710 invoked by uid 500); 3 Jan 2010 21:46:16 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 82635 invoked by uid 500); 3 Jan 2010 21:46:16 -0000 Mailing-List: contact user-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@couchdb.apache.org Delivered-To: mailing list user@couchdb.apache.org Received: (qmail 82625 invoked by uid 99); 3 Jan 2010 21:46:16 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 03 Jan 2010 21:46:16 +0000 X-ASF-Spam-Status: No, hits=1.5 required=10.0 tests=SPF_PASS,WEIRD_PORT X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of matteo.caprari@gmail.com designates 209.85.219.216 as permitted sender) Received: from [209.85.219.216] (HELO mail-ew0-f216.google.com) (209.85.219.216) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 03 Jan 2010 21:46:06 +0000 Received: by ewy8 with SMTP id 8so13797164ewy.35 for ; Sun, 03 Jan 2010 13:45:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type; bh=swyxnWgKkhCSZQ4yjO13VPosnEK/HATTFVnEyoJmeSM=; b=r1FqAac17czmL9AijXkFAmFFVTak32eb8qlR5PQoknklBQGhPO/wF6HStOaKl5UvSf laLlLgQ2plHQ0y4xihStiUmE7I1JhqU3CXVef0vqtjoJaxrK0l8I7mgy/E8L6oIMlf7M FcoelM6VvD7p0RPjzQKqNzseo4O+Iz6V7LgfQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; b=g+4SGRCOIxZ4VP3NnGY4gxqimQbO2OgmmavAp8tZO0mhu/fKCpi1m796a8X2RQIJe9 M34ySCuK0Y4hpmwgEnG/suUbYsva9zeS1MkvwSJ/Z3LD1ZeMi2JWD6uiwlurcpkZrB1F DLJlzAgK/FtI4m9519YU/fcCCG2go574PQEGs= MIME-Version: 1.0 Received: by 10.216.89.138 with SMTP id c10mr3082360wef.47.1262555144093; Sun, 03 Jan 2010 13:45:44 -0800 (PST) In-Reply-To: References: <1bca98391001030457m52aca7d8lf77edd06375f41c6@mail.gmail.com> <1bca98391001031203n4315e5f0j3f2cdfe4e7ceaa34@mail.gmail.com> From: Matteo Caprari Date: Sun, 3 Jan 2010 21:45:24 +0000 Message-ID: <1bca98391001031345l2e656b7fo7df42ea6b0413217@mail.gmail.com> Subject: Re: sample couchdb application To: user@couchdb.apache.org Content-Type: text/plain; charset=UTF-8 I'm still working on a patch to have lists consume multiple views. That should extend a list capability but still probably not cover that case. On Sun, Jan 3, 2010 at 9:31 PM, Chris Anderson wrote: > On Sun, Jan 3, 2010 at 12:03 PM, Matteo Caprari > wrote: >> Hi Chris. >> >> I haven't actually integrated nor automated anything: I run jsdoc >> manually before each redeploy. I'm looking into an >> integration with couchap but christmas got in the way and accomplished >> nothing yet. >> >> I think I had some problems with ordering by question date because answers don't >> have the question timestamp and didn't know what key to emit to keep >> the item adjacent. > > The way I handle this in Sofa is by having two views: > > One would be all questions by date. > > The other is questions together with answers by date. (The question > and answer groups are in this view in a random order). > > There's no sane way to do the second view with the questions also > sorted by date... > > Chris > >> >> But I like your optimism, so I'll try my head again and maybe ask again. >> >> I'll sync the app with your suggestions and post the results to this thread. >> >> thanks for your support. >> >> On Sun, Jan 3, 2010 at 7:07 PM, Chris Anderson wrote: >>> On Sun, Jan 3, 2010 at 4:57 AM, Matteo Caprari wrote: >>>> Hello list. >>>> >>>> I've cranked up a simple couchapp that mimics stackoverflow.com (if you squint). >>>> >>>> The idea is to understand couchdb better and provide the base for a >>>> tutorial, but >>>> before going any deeper, I'd like to hear from you what is wrong and >>>> what is good. >>> >>> This is great stuff. Really cool. I still don't understand all of how >>> you've integrated things, but the documentation is really a great >>> addition. >>> >>> I think this is a really cool use case. Thanks for sharing! >>> >>> One concern I have is that I don't think you need to be building >>> custom _ids. You should be able to accomplish your lists and shows >>> without messing with custom ids, instead using document parameters in >>> views. Custom ids generally just add code-overhead to apps and >>> increase the chances of spurious conflicts. >>> >>> To avoid double posts, PUT with a random docid should be idempotent, >>> and fail on duplicate PUTs. If you can't do PUT from your client the >>> _bulk_docs POST api should work to, if you specify ids. See how >>> jquery.couch.js has an API for getting UUIDs from the Couch and then >>> using them on new docs. >>> >>> Also, in trunk _show is no longer happy to have bogus ids, you'll get >>> a 404. You can invoke with no docid at all to accomplish your use >>> case. >>> >>> I'm happy to help more so that when you write your tutorial it >>> embodies best practices. Just post any questions to this thread! >>> >>> Cheers, >>> Chris >>> >>> >>>> >>>> So please have a look, but don't expect too much. >>>> >>>> Demo: http://caprazzi.net:5984/fortytwo/_design/fortytwo/index.html >>>> Docs: http://caprazzi.net:5984/fortytwo/_design/fortytwo/docs/index.html >>>> Source: http://github.com/mcaprari/fortytwo >>>> >>>> Docs are created with jsdoc-toolkit and a custom template. >>>> I think we could integrate it with couchapp to obtain a "view source" feature. >>>> >>>> -- >>>> :Matteo Caprari >>>> matteo.caprari@gmail.com >>>> >>> >>> >>> >>> -- >>> Chris Anderson >>> http://jchrisa.net >>> http://couch.io >>> >> >> >> >> -- >> :Matteo Caprari >> matteo.caprari@gmail.com >> > > > > -- > Chris Anderson > http://jchrisa.net > http://couch.io > -- :Matteo Caprari matteo.caprari@gmail.com