From MongoDB with love
# Dirty hack to remove JavaScript objects
output.gsub!(/ISODate\((.+?)\)/, '\1 ')
output.gsub!(/Timestamp\((.+?)\)/, '[\1]')
#Hack to avoid non-json empty sets
output = "{}" if output == "null\n"
JSON.parse(output)# Dirty hack to remove JavaScript objects
output.gsub!(/ISODate\((.+?)\)/, '\1 ')
output.gsub!(/Timestamp\((.+?)\)/, '[\1]')
#Hack to avoid non-json empty sets
output = "{}" if output == "null\n"
JSON.parse(output)