Ejemplo n.º 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;
      }
    }
  }
Ejemplo n.º 2
0
 @Override
 public void dropIndex(Bson arg0) {
   coll.dropIndex(arg0);
 }
Ejemplo n.º 3
0
 @Override
 public void dropIndex(String arg0) {
   coll.dropIndex(arg0);
 }