Return-Path: X-Original-To: apmail-couchdb-user-archive@www.apache.org Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id D7BAECBB2 for ; Thu, 3 May 2012 15:09:17 +0000 (UTC) Received: (qmail 87374 invoked by uid 500); 3 May 2012 15:09:16 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 87327 invoked by uid 500); 3 May 2012 15:09: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 87319 invoked by uid 99); 3 May 2012 15:09:16 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 03 May 2012 15:09:16 +0000 X-ASF-Spam-Status: No, hits=2.5 required=5.0 tests=FROM_12LTRDOM,HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (nike.apache.org: local policy) Received: from [209.85.220.180] (HELO mail-vx0-f180.google.com) (209.85.220.180) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 03 May 2012 15:09:09 +0000 Received: by vcbfl10 with SMTP id fl10so1776829vcb.11 for ; Thu, 03 May 2012 08:08:47 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:x-originating-ip:date:message-id:subject:from:to :content-type:x-gm-message-state; bh=98Gkl7sqssRfpuIis5gCaXHbmXDnH7P+trxWZqoxwas=; b=TvN3zA6P4iduB4tWm1+1Dy3KKpQGKwXCDRECFPZH5BQvMdvanDf+Q6mgvqBnz1dC7Y 8Vrv77D+UkHb+xmamvTQGFetFEnJpDnwfsdbo5BZjnRBqXxSqtWMkX4ECivZAfV1To3F jF/cr7T9Z9ceEz6UP/e/7gOilrN/9UzMevE1rl1uaPxH08m5OhL9tpCm4cuka7tVSKtU OurNMG6U9RtZMWBUPMALmGI4G+ts+12zRZ3e262zUQ8TodXEUFbFclVm4z0TTVQuRomX RW+Vq0s9R1+b01rkd8KtvCibABHUwvr2kAmZfPRYxd6yesQfGujmkhclkCFxg0GFlbMA 29Jg== MIME-Version: 1.0 Received: by 10.220.219.9 with SMTP id hs9mr304535vcb.2.1336057727624; Thu, 03 May 2012 08:08:47 -0700 (PDT) Received: by 10.52.94.197 with HTTP; Thu, 3 May 2012 08:08:47 -0700 (PDT) X-Originating-IP: [156.33.195.149] Date: Thu, 3 May 2012 08:08:47 -0700 Message-ID: Subject: View Including Documents It Doesn't Seem Like It Should From: Matthew Woodward To: user@couchdb.apache.org Content-Type: multipart/alternative; boundary=14dae9cfce1a41273f04bf232e15 X-Gm-Message-State: ALoCoQlSZFLJ6i/te9JDrHnKQ9msgeTZo8x3UAk4I+1MxQuYrZK4KKWp21KvrUFvP7H9cl1/Ofsb --14dae9cfce1a41273f04bf232e15 Content-Type: text/plain; charset=ISO-8859-1 I'm sure Couch is doing exactly what it's supposed to so I'm really asking in order to understand why it's behaving this way. I'm working on a learning management system that has classes in it, and the class document has (among other things) a course ID (a course has multiple instances of classes associated with it), a learning method, and a date/time. For reference the learning method value will be one of either Classroom, Webinar, Videoconference, or Self-Paced, and my dates I'm formatting this way: "2012/05/01 08:00" I wrote a view that pulls classes with an array key including the course ID, the learning method, and the date: if (doc.type == 'class') { emit([doc.courseID, doc.learningMethod, doc.dtStart], null); } What I want to be able to pull is all classes for a specific course ID, ordered by learning method, but within a specific date range. When I use this start key, however, it pulls documents with a dtStart values outside the date range: ["courseidhere","A","2012/05/01 00:00"] In that case I'll get classes with a start date in April, for example. And just so it's clear, I'm using "A" as the start key for the learning option so I grab all the learning options. As I said my guess is I'm not quite understanding how the array keys work to the point where I get why given that start key it would pull documents with dates before what I have in my start key, so I'd appreciate any insight people might have. Thanks. -- Matthew Woodward matt@mattwoodward.com http://blog.mattwoodward.com identi.ca / Twitter: @mpwoodward Please do not send me proprietary file formats such as Word, PowerPoint, etc. as attachments. http://www.gnu.org/philosophy/no-word-attachments.html --14dae9cfce1a41273f04bf232e15--