couchdb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Meno Abels (JIRA)" <>
Subject [jira] Commented: (COUCHDB-528) Views and keyed access
Date Thu, 15 Oct 2009 05:11:31 GMT


Meno Abels commented on COUCHDB-528:

The seams to be clear to me, but i though that emit(null,null) will take every thing which
is mapped. 
So I dont need to specify a key. 
In fact if I query without key-ranges and use emit(null,null) i get all documents, so why
I has the emit
be different if I query with a key-range. 
I now know there is no difference between emit(doc._id,null) in result without a key-range.
If hust looks for me a bit disurbing, of course in the key-range query i need the doc.xxxx
as the first 
emit parameter to get results and without key-range i dont need. 

> Views and keyed access
> ----------------------
>                 Key: COUCHDB-528
>                 URL:
>             Project: CouchDB
>          Issue Type: Bug
>          Components: Database Core
>    Affects Versions: 0.9.1
>         Environment: linux
>            Reporter: Meno Abels
> If you try eg.
> curl -v -d '{"keys":["srp_WPG","srp_WLUX"]}' http://localhost:5984/booking_reverseidxes/_design/Booking::ReverseIdx-0aab4fe0eb7bdb4ac59f67c4e9453b52/_view/all
> you will except in the best case a answer of two rows. If the two key rows exists. If
I use _all_docs it works like excepted. If I use a view the answer is a empty rows array.

> I had a in depth look to the source in ./src/couchdb/couch_httpd_view.erl
> but I am just to new with erlang, to find the problem and fix it. 
> It is still possible that I make a usage error, than feel free to blame me.
> I expect the problem in
> output_map_view(Req, View, Group, Db, QueryArgs, Keys) ->
> ....
> FoldlFun = make_view_fold_fun(Req,
>                     QueryArgs#view_query_args{
>                         start_key = Key,
>                         end_key = Key
>                     }, CurrentEtag, Db, RowCount,
>                     #view_fold_helper_funs{
>                         reduce_count = fun couch_view:reduce_to_count/1
>                     })
> which is the only differend code part between keyed and none keyed access.
> My map method in the view looks like this which should be harmless and not depend to
the problem.
> {
>    "all": {
>        "map": "function(doc) {
>                  if (doc['couchrest-type'] == 'Booking::ReverseIdx') { emit(null,null);
>         }"
>    }
> }
> thx in advance
> meno

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message