I am having an issue trying to save data to MongoDB.
I first run this python program:
import pymongo
import sys
def main():
connection = pymongo.Connection("mongodb://localhost", safe = True)
db = connection.m101
people = db.people
person = {'name':'Barack Obama', 'role':'president'}
people.insert(person)
but then, when i try to retrieve the data from the mongoshell:
> use m101
switched to db m101
> db.people.find()
returns nothing! I'm not sure what is going on. Thanks for your help.