eiri commented on issue #627: Pass UserCtx to fabric's all_docs from mango query
URL: https://github.com/apache/couchdb/pull/627#issuecomment-313163981
 
 
   This turned out to be more complicated, two-fold issue:
   
   1) `fabric:query_view/6` always expects `Acc` to be `#vacc` record and we 
are passing `#cursor` from mango there, so when an index presented it is indeed 
crashing with `badrecord`. Different issue than what's fixed here.
   
   2) We don't pass user context to db from `fabric_view_map` at all, so 
`including_docs` not working on `_users` db even without mango, on honest views:
   
   ```
   $ echo '{"name": "demo", "password": "apple", "roles": [], "type": "user"}' 
| http put :15984/_users/org.couchdb.user:demo
   {
       "id": "org.couchdb.user:demo",
       "ok": true,
       "rev": "1-16edca99a7b08fc65cdc963f40c9fa9d"
   }
   
   
   $ echo '{"views": {"names": {"map": "function(doc) { emit(doc.name); }"}}}' 
| http put :15984/_users/_design/users 
   {
       "id": "_design/users",
       "ok": true,
       "rev": "1-fb4b161306a6da60301f313cc827704c"
   }
   
   $ http :15984/_users/_design/users/_view/names include_docs==true
   {
       "offset": 0,
       "rows": [
           {
               "doc": null,
               "id": "org.couchdb.user:demo",
               "key": "demo",
               "value": null
           }
       ],
       "total_rows": 1
   }
   ```
   
   That "doc" shouldn't be `null`. 
   
   So I'm going to fix that in separate PR, amend this one to work for mango 
indexes and make it depended on the former.
 
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to