Created
January 6, 2012 22:22
-
-
Save mpobrien/1572697 to your computer and use it in GitHub Desktop.
json example
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
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