List of usage examples for com.mongodb DBCollection getName
public String getName()
From source file:org.teiid.translator.mongodb.MongoDBUpdateExecution.java
License:Open Source License
private void createIndex(DBCollection collection, KeyRecord record, boolean unique) { BasicDBObject key = new BasicDBObject(); for (Column c : record.getColumns()) { key.append(getRecordName(c), 1); }//from w w w .j a v a2 s. c om BasicDBObject options = new BasicDBObject(); options.put("name", record.getName()); //$NON-NLS-1$ options.put("ns", collection.getName()); //$NON-NLS-1$ if (unique) { options.put("unique", Boolean.TRUE); //$NON-NLS-1$ } collection.createIndex(key, options); }