Created
February 1, 2013 01:19
-
-
Save gtcarlos/4688363 to your computer and use it in GitHub Desktop.
Python code to connect to the database MongoDB and select first one.
This file contains 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 pymongo | |
from pymongo import Connection | |
connection = Connection('localhost', 27017) | |
db = connection.test | |
names = db.names | |
item = names.find_one() | |
print item['name'] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment