Skip to content

Instantly share code, notes, and snippets.

@whilefalse
whilefalse / Pymongo Dereference a List
Created August 21, 2009 09:04
Pymongo has some really cool auto dereferencing stuff build in. However, web.py was playing with my session object and saving back the dereferenced version. This allows me to dereference a list of DBRefs manually.
def deref_list(db, list):
return map(lambda(ref): db.dereference(ref), list)