I have a number of docs with following structure.
{
_id:"",
url:"",
users_linked:[1,2,3...]
}
Whenever a user logs in I want to show him all URLs except those which are linked to hi, my map function does
for(i in doc.users_linked){ emit(doc.users_linked[i],doc.url); }
Help.
If I understand it correctly, given an user with id==USERID, you want the inverse of querying your view with
key=USERID.The only solution I know, is to do two queries to the view you provided:
endkey=USERID&inclusive_end=falsestartkey=<USERID+1>.I’m assuming from your sample document that userids are numerical.