Guest User

Untitled

a guest
Nov 18th, 2018
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. Given the following document structure:
  2.  
  3. {
  4. '_id' : 'someid',
  5. '_rev' : 'somerev',
  6. 'metadata' : {
  7. 'participation' : {
  8. 'read' : [1,2,3,4,5]
  9. }
  10. }
  11. }
  12.  
  13. I want to find all documents in a database where a specific
  14. value **does not** exist in the `metadata.participation.read`
  15. array
  16.  
  17. Querying for documents in which **metadata.participation.read**
  18. contains the specific value has been easy:
  19.  
  20. function(doc) {
  21. doc['metadata']['participation']['read'].forEach(function(user_id) {
  22. emit(user_id, doc._id);
  23. });
  24. }
Add Comment
Please, Sign In to add comment