Get() публичный Метод

Get a exist collection. Returns null if not exists
public Get ( string name ) : CollectionPage
name string
Результат CollectionPage
Пример #1
0
        /// <summary>
        /// List all unique indexes (excluding _id index)
        /// </summary>
        public IEnumerable <string> GetUniqueIndexes(string collection)
        {
            var col = _collections.Get(collection);

            foreach (var index in col.Indexes.Where(x => x.Field != "_id" && x.Unique))
            {
                yield return(index.Field);
            }
        }
Пример #2
0
        /// <summary>
        /// List all indexes keys with unique information
        /// </summary>
        public IEnumerable <KeyValuePair <string, bool> > GetIndexes(string collection)
        {
            var col = _collections.Get(collection);

            foreach (var index in col.Indexes.Where(x => x.Field != "_id" && string.IsNullOrEmpty(x.Field) == false))
            {
                yield return(new KeyValuePair <string, bool>(index.Field, index.Options.Unique));
            }
        }