couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Randall Leeds <randall.le...@gmail.com>
Subject Re: querying an array view with startkey and endkey
Date Thu, 22 Jul 2010 02:29:29 GMT
http://wiki.apache.org/couchdb/View_collation

Your answer is there :)

startkey=["file", "fileA"]
endkey=["file", "fileA\ufff0"]

Cheers!
Randall

On Jul 21, 2010 7:18 PM, "Steven Prentice" <steven.prentice.87@gmail.com>
wrote:

Hi couchers

say I have the following keys: ["file", "FileA", "folder", "folderA"]
["file", "FileA", "null", "null"] ["file", "FileB", "folder", "folderB"]
I want to use startkey=["file", "FileA"] to find all the fileA documents
regardless of if they have folders or not. But I don't want any FileB's
showing up afterwards!
I can't put endkey=["file", "fileB"] because I am not going to know that
fileB is the next id in the view before I make the request, it could be
anything!

Basically I am looking ot find out how to limit the view to only keys that
start with ["file", "FileA"]. Is there some sort of 'special character' I
could put into endkey or something to do so?

p.s my aim is to not have to make another view that has a smaller key of
["file", "fileID"]

Cheers
Steve

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message