public static void Update(Course course)
 {
     collection.Update(new QueryDocument { { "_id", course.Id } },
         new UpdateDocument { { "$set",
                                  new BsonDocument {
                                  {"CourseNo", course.CourseNo },
                                  {"Name", course.Name},
                                  {"Period", course.Period},
                                  {"Credit", course.Credit}}
                                  }});
 }
        public static bool AddCourse(Course course)
        {
            var query = Query.EQ("CourseNo", course.CourseNo);

            if (collection.Find(query).Count() > 0) return false;
            else
            {
                collection.Insert<Course>(course);
                return true;
            }
        }