Esempio n. 1
0
        /// <summary>
        ///   Creates the collection.
        /// </summary>
        /// <param name = "name">The name.</param>
        /// <param name = "options">The options.</param>
        /// <returns></returns>
        public IMongoCollection CreateCollection(string name, Document options)
        {
            var cmd = new Document();

            cmd.Add("create", name).Merge(options);
            _database.SendCommand(cmd);
            return(new MongoCollection(_configuration, _connection, _name, name));
        }
Esempio n. 2
0
        /// <summary>
        ///   Drops the index.
        /// </summary>
        /// <param name = "name">The name.</param>
        public void DropIndex(string name)
        {
            var cmd = new Document();

            cmd.Add("deleteIndexes", _name).Add("index", name);
            _database.SendCommand(cmd);
            Refresh();
        }