Reputation: 147
i want to extract only the value from the domain document
import socket
from pymongo import MongoClient
client = MongoClient()
db = client.my_domains
collection = db.domain
document = collection.find({},{'domain': 1, '_id':0})
for d in document:
print(d)
Result is :
{u'domain': u'301udns.info'}
{u'domain': u'idcay.com'}
How can extract only the value like 301udns.info for my example. Thank you in advance for your answer.
Upvotes: 1
Views: 338