Insert documents into MongoDB only if all fields are unique
问题 I have the following class structure: public class DBTestItem { public int p0; public int p1; public int p2; public int p3; public int p4; public int p5; public int p6; public int p7; public string data; } public sealed class MongoTestItem : DBTestItem { public ObjectId _id; } _id is meaningless to me. p0 - p7 represent a composite key, and data represents the value. I want to save MongoTestItem documents where data is unique, and ideally without performing updates as they would be