How to force mongo to store members in lowercase?
问题 I have a collection of BsonDocuments, for example: MongoCollection<BsonDocument> products; When I do inserts into the collection, I want the member name to always be lowercase. After reading the documentation, it appears that ConventionPack is the way to go. So, I've defined one like this: public class LowerCaseElementNameConvention : IMemberMapConvention { public void Apply(BsonMemberMap memberMap) { memberMap.SetElementName(memberMap.MemberName.ToLower()); } public string Name { get { throw