I am trying to put together a program that wil parse through mongodb and get each page (eventually I will want to graph it) but I don't know what I am doing wrong here. I have been through the tutorial http://api.mongodb.org/python/2.0/tutorial.html but it I don't know how to query dynamically (looping through). My guess is that it has something to do with results being returned in unicode but i'm not sure. Here is my code.
import pymonogo
from pymongo import Connection
c = Connection()
dbs = c.database_names()
for db in dbs:
print db
for col in c[db].collection_names():
print '\t', col
for pag in c[db].col.find():
print pag
I'm just doing some analytics on an existing databases. (I have about 5 dbs that each have 1-20 collections, each collection has from 0 - 1500 pages. I am hoping to graph the pages, but I haven't gotten far enough into the graphing library yet to see exactly how that will work out.
If you can help thanks.