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>()); }
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()); }
public static void UpdateHeritageProjectMainContent(BsonDocument bson) { MongodbMain.GetCollection(MongodbMain.HeritageProjectMainPage).FindOneAndUpdate(new BsonDocument(), bson); }
public static void UpdateACollection(BsonDocument newInfo, string collectionName, BsonDocument condition) { MongodbMain.GetCollection(collectionName).FindOneAndUpdate(condition, newInfo); }