Пример #1
0
  private static void dropIndexIfExists(MongoCollection<Document> col, String fieldName) {
    for (Document d : col.listIndexes()) {
      if (d.get("key", Document.class).containsKey(fieldName)) {
        logger.warn("Schema migration. Dropping index: " + fieldName + " ...");

        try {
          col.dropIndex(fieldName);
        } catch (Exception swallowed) {
        } // because not implemented in Fongo

        return;
      }
    }
  }
Пример #2
0
 @Override
 public void dropIndex(Bson arg0) {
   coll.dropIndex(arg0);
 }
Пример #3
0
 @Override
 public void dropIndex(String arg0) {
   coll.dropIndex(arg0);
 }