Example #1
0
        public static BsonDocument GetHeritageProjectMainPageDesc()
        {
            var collection = MongodbMain.GetCollection(MongodbMain.HeritageProjectMainPage);
            var result     = collection.Find <BsonDocument>(new BsonDocument());

            if (result == null || result.CountDocuments() == 0)
            {
                return(null);
            }
            return(result.First <BsonDocument>());
        }
Example #2
0
        public static BsonDocument GetACollection(string collectionName)
        {
            var collection = MongodbMain.GetCollection(collectionName);
            var result     = collection.Find <BsonDocument>(new BsonDocument());

            if (result == null || result.CountDocuments() == 0)
            {
                return(null);
            }
            return(result.First());
        }
Example #3
0
 public static void UpdateHeritageProjectMainContent(BsonDocument bson)
 {
     MongodbMain.GetCollection(MongodbMain.HeritageProjectMainPage).FindOneAndUpdate(new BsonDocument(), bson);
 }
Example #4
0
 public static void UpdateACollection(BsonDocument newInfo, string collectionName, BsonDocument condition)
 {
     MongodbMain.GetCollection(collectionName).FindOneAndUpdate(condition, newInfo);
 }