public BasicBSONListWrapper(BasicBSONList list) { this.it = list.iterator(); }
/** * Removes the first entity with the given hostname and port from the list of members */ public ReplicaSetConfig remove(String hostname, Integer port) { String host = String.format("%s:%s", hostname, port); Iterator<Object> it = this.members.iterator(); while (it.hasNext()) { Object next = it.next(); if (next instanceof BasicBSONObject) { BasicBSONObject basicBSONObject = (BasicBSONObject) next; if (host.equals(basicBSONObject.getString("host"))) { it.remove(); break; } } } return this; }