Created
May 19, 2013 16:21
-
-
Save munk/5608141 to your computer and use it in GitHub Desktop.
Some tools for a mongo course, written in python using an obfuscated functional style with emacs lambda substitution
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
from pymongo import Connection as Cn | |
from itertools import chain as ch | |
collection = λ D, C: Cn()[D][C] | |
orphans = λ c, d, j, k: {[i[j] for i in c]} - {ch(*[a[k] for a in d])} | |
remove = λ d, k, c: map(d[k].remove, c) | |
verify = λ k, t: filter(λ i: k in i[t], c) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment