Last active
December 7, 2015 16:22
-
-
Save ronycohen/b617fcdec968e2dd6f5e to your computer and use it in GitHub Desktop.
DESIGN DOC
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{"$or":[{"name":"james"},{"name":"doe"}]} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"_id": "_design/19398d38b0a026e2b1e4a82dfa5aea65a51c0782", | |
"_rev": "1-a500b8628ef2ae8123b6f6f527288d01", | |
"language": "query", | |
"views": { | |
"19398d38b0a026e2b1e4a82dfa5aea65a51c0782": { | |
"map": { | |
"fields": { | |
"name": "asc", | |
"colors": "asc", | |
"timestamp": "asc" | |
} | |
}, | |
"reduce": "_count", | |
"options": { | |
"def": { | |
"fields": [ | |
"name", | |
"colors", | |
"timestamp" | |
] | |
}, | |
"w": 2 | |
} | |
} | |
} | |
} | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
selector : { | |
"$and": [ | |
{ | |
'timestamp': {'$gte': 0}, | |
}, | |
{ | |
"$or" : [ | |
{ | |
"$and" : [ | |
{"name":{"$eq":"james"}}, | |
{"colors":{"$elemMatch":{"$in":["red","blue"]}}} | |
]}, | |
{ | |
"$and" : [ | |
{"name":{"$eq":"doe"}}, | |
{"colors":{"$elemMatch":{"$in":["orange","black"]}}} | |
]} | |
] | |
} | |
] | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
selector : { | |
"$and": [ | |
{ | |
'timestamp': {'$gte': 0}, | |
}, | |
{ | |
"$and" : [ | |
{"name":{"$eq":"doe"}}, | |
{"colors":{"$elemMatch":{"$in":["red","blue","black"]}}} | |
] | |
} | |
] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment