Example #1
0
        /// <summary>
        /// Create a new permanent index in all documents inside this collections if index not exists already.
        /// </summary>
        /// <param name="property">Property linq expression</param>
        /// <param name="unique">Create a unique values index?</param>
        public virtual bool EnsureIndex <K>(Expression <Func <T, K> > property, bool unique = false)
        {
            var p = QueryVisitor.GetProperty <T, K>(property);

            return(this.EnsureIndex(p.Name, unique));
        }