title: C# Insert BSON Document Into MongoDB
body: <p>I've written an program that scrapes certain sites for ads, jobs, etc, and inserts a list of objects into a SQL Server database. Now I am trying to insert data into MongoDB by creating a string of JSON and parsing it to a BSON Document. But when I check to see what databases were created in MongoDB, it appears that the database is empty- no memory used, no collections exist.<a href="https://i.stack.imgur.com/hP4AT.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/hP4AT.jpg" alt="MongoDB.exe"></a></p>
  
  <pre><code> //A manager class calls the scraper class to retrieve lists of objects 
   //for each category and city. Then I pass a string of the data converted to 
   //JSON to the MongoDB Insert function.
  
   //in the Manager class
   public string JobsJson()
   {
          return JsonConvert.SerializeObject(this);
   }
  
   //in main
   JobManager manager = new JobManager();
  
    manager.FillJobs();
  
    MongoDB.InsertJobs(manager.JobsJson());
  
   //and the database class parses the JSON into a BSON Document.
   class MongoDB
   {
      public static void InsertJobs(string json)
      {
          var Client = new MongoClient();
  
          var MongoDB = Client.GetDatabase("JobSearch");
  
          var Collec = MongoDB.GetCollection&lt;BsonDocument&gt;("Gigs");
  
          BsonDocument document = BsonDocument.Parse(json);
  
          Collec.InsertOneAsync(document);         
  
          Console.ReadKey();
      }
  }
  </code></pre>
  
  <p>I've checked the JSON by printing it to the screen to see that it is legitimate. Why is data not being stored in my MongoDB?</p>