using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Ant.Service.Mongodb { /// /// Mongodb数据库的字段特性 主要是设置索引之用 /// [AttributeUsage(AttributeTargets.Property, AllowMultiple = false)] public class MongoDbFieldAttribute : Attribute { /// /// 是否是索引 /// public bool IsIndex { get; set; } /// /// 是否是唯一的 默认flase /// public bool Unique { get; set; } /// /// 是否是升序 默认true /// public bool Ascending { get; set; } public MongoDbFieldAttribute(bool _isIndex) { this.IsIndex = _isIndex; this.Unique = false; this.Ascending = true; } } }