예제 #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);
 }