title: Return Single result from mongo doc
body: <p>Hi I am trying to make a generic method to return a single value from the database 
  I am not sure where to put the return result, value is returned as a BSON document.I need 1 value from it....</p>
  
  <pre><code>    public static string SearchMongoSingleValue(string key, string value, string ducument, string datatable)
       {
           var connectionString = "mongodb://localhost";
           var client = new MongoClient(connectionString);
           var server = client.GetServer();
           var database = server.GetDatabase(datatable);
           var collection = database.GetCollection(ducument);
           var query = Query.EQ(key, value);
           var oneDocument = collection.FindOne(query);
  
           return oneDocument[value];
  </code></pre>
  
  <p>Thanks</p>