Skip to content

Instantly share code, notes, and snippets.

@mpobrien
Created January 6, 2012 22:22
Show Gist options
  • Save mpobrien/1572697 to your computer and use it in GitHub Desktop.
Save mpobrien/1572697 to your computer and use it in GitHub Desktop.
json example
import json
from pymongo.objectid import ObjectId
from pymongo import json_util
from pymongo import Connection
db = Connection().newdb
items = list(db.spider.find())
print json.dumps(items, default=json_util.default, sort_keys=True, indent=4)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment