0

I have a requirement to capture likes or dislikes on news. I am storing it in Cloudant DB with news details and users who liked and disliked.

{ "id":"news-001" dislike:[ 'user@gmail.com'] }

I am capturing 1000's of news articles. I need a search index so that i can filter for specific user who disliked the articles during search result itself rather than manually checking for user email in my loop code.
I tried multiple options since Cloudant does not support to use of logical NOT alone. Please suggest options

Megidd
  • 7,089
  • 6
  • 65
  • 142
jmanoj86
  • 7
  • 5

1 Answers1

0

I believe you'd need to create an index of users from the dislike array and then search on that.

The answer to this question should help you with querying on an array: https://stackoverflow.com/questions/43892556/mango-search-in-arrays-couchdb stackoverflow.com