public ClojureCollectionAdmin(ClojureDBCollection collection) {
super(collection);
}
public void ensureIndex(boolean unique, boolean dropDups, IPersistentStack fields) {
IndexOptionsBuilder options = new IndexOptionsBuilder();
while (fields.count() > 0) {
Object fieldName = fields.peek();
if (fieldName instanceof Keyword) {
Keyword k = (Keyword) fieldName;
fieldName = k.getName();
}
options.field(fieldName.toString()).ascending();
fields = fields.pop();
}
if (unique) {
options.unique();
}
if (dropDups) {
options.dropDups();
}
ensureIndex(options);
}