sudo apt-get install -y mongodb-org
python3 -m pip install -U pymongo
mongod
service mongod start
mongoimport --db aapb --collection pbcore --file /Volumes/U/AAPB_MongoDB_data/PBCore_JSON_70K.txt
from pymongo import MongoClient
from pprint import pprint
client = MongoClient()
records = client.aapbsample.pbcore
cursor = records.find({ 'pbcoreDescriptionDocument.pbcoreCreator.creator' : "Worden, Michelle"})
for item in cursor:
pprint(item)
cursor = records.find({ 'pbcoreDescriptionDocument.pbcoreTitle.#text' : "Grace: A Tribute to Pope John Paul II"})
for item in cursor:
pprint(item)
cursor = records.find({ 'pbcoreDescriptionDocument.pbcoreGenre.#text' : "Music"})
for item in cursor:
pprint(item)
cursor = records.find({ 'pbcoreDescriptionDocument.pbcoreDescription.#text' : {'$regex':'.*Arkansas.*'}})
for item in cursor:
pprint(item)