I am trying to connect to my Twitter application by fetching the consumer key and access token from a MongoDatabase. I'm relatively new to MongoDB and am still trying to get a handle on things. I need the data as a string, but it's being returned as a cursor. I understand that what I have so far won't be the exact value im looking for, but rather something like
{"value" : "ggggktjjjfr4kf0k04kf0rkforvo"}
but if I could at least get this as a string I could begin to decode it. Any advice would be appreciated.
consumer_key = collection_Authentication.find({"name":"consumer_key"}, {"_id":0, "value":1})
consumer_secret=collection_Authentication.find({"name":"consumer_secret"}, {"_id":0, "value":1})
access_token = collection_Authentication.find({"name":"access_token"}, {"_id":0, "value":1})
access_secret = collection_Authentication.find({"name":"access_secret"}, {"_id":0, "value":1})
.find_one()and access the key of the dict returned. i.econsumer_key = collection_Authentication.find_one({"name":"consumer_key"}, {"_id":0, "value":1})["value"]