I have lost probably one whole day to this problem. I can't find where my MongoDB stores data. it's not in user/data/db. I ran ps -xa | grep mongod and it's not in any of the directories listed there. When I start mongodb and execute show dbs I get a list of empty databases. No idea where on hard drive they are. At this point I have no clue what is happening. The code I am running is taken from another web site and is working. It shows that elements are being inserted into db. I tried everything that I know of and nothing is working. Here is the code:
auth1 = tweepy.OAuthHandler(consumer_key, consumer_secret)
auth1.set_access_token(access_token, access_token_secret)
class StreamListener(tweepy.StreamListener):
def on_status(self, tweet):
print tweet.text
def on_error(self, status_code):
print 'Error: ' + repr(status_code)
return False
def on_data(self, data):
print 'Ok! Inserting Data.'
from pymongo import MongoClient
client = MongoClient()
client = MongoClient('localhost', 27017)
db = client.test
test_id = db.twittertest.insert(json.loads(data))
l = StreamListener()
streamer = tweepy.Stream(auth=auth1, listener=l)
streamer.sample()