vibe.d beta banner
get vibe.d
0.10.0

Asynchronous I/O that doesn’t get in your way, written in D

MongoCollection.dropIndexes - multiple declarations

Function MongoCollection.dropIndexes

Drops all indexes in the collection.

void dropIndexes (
  DropIndexOptions options = DropIndexOptions(Nullable(DontCallDestructorT(), true))
) @safe;

Function MongoCollection.dropIndexes

Unofficial API extension, more efficient multi-index removal on MongoDB 4.2+

void dropIndexes (
  string[] names,
  DropIndexOptions options = DropIndexOptions(Nullable(DontCallDestructorT(), true))
) @safe;

Example

import vibe.db.mongo.mongo;

void test()
{
	auto coll = connectMongoDB("127.0.0.1").getCollection("test");
	coll.dropIndexes(["name_1_primarykey_-1"]);
}

Authors

Sönke Ludwig

Copyright

© 2012-2016 Sönke Ludwig

License

Subject to the terms of the MIT license, as written in the included LICENSE.txt file.