private MongoException translateException(final Throwable t) { return (t instanceof MongoCommandException) ? checkForDuplicateKeyError((MongoCommandException) t) : MongoException.fromThrowable(t); }
private BsonDocument getCommand(final ConnectionDescription description) { BsonDocument command = new BsonDocument("createIndexes", new BsonString(namespace.getCollectionName())); List<BsonDocument> values = new ArrayList<BsonDocument>(); for (IndexRequest request : requests) { values.add(getIndex(request)); } command.put("indexes", new BsonArray(values)); putIfNotZero(command, "maxTimeMS", maxTimeMS); appendWriteConcernToCommand(writeConcern, command, description); return command; }
); return new CreateIndexesOperation(namespace, indexRequests, writeConcern) .maxTime(createIndexOptions.getMaxTime(MILLISECONDS), MILLISECONDS);
request.collation(DBObjectCollationHelper.createCollationFromOptions(options)); return new CreateIndexesOperation(getNamespace(), singletonList(request), writeConcern);
); return new CreateIndexesOperation(namespace, indexRequests, writeConcern) .maxTime(createIndexOptions.getMaxTime(MILLISECONDS), MILLISECONDS);
request.collation(DBObjectCollationHelper.createCollationFromOptions(options)); return new CreateIndexesOperation(getNamespace(), singletonList(request), writeConcern);
private BsonDocument getCommand(final ConnectionDescription description) { BsonDocument command = new BsonDocument("createIndexes", new BsonString(namespace.getCollectionName())); List<BsonDocument> values = new ArrayList<BsonDocument>(); for (IndexRequest request : requests) { values.add(getIndex(request)); } command.put("indexes", new BsonArray(values)); putIfNotZero(command, "maxTimeMS", maxTimeMS); appendWriteConcernToCommand(writeConcern, command, description); return command; }
private MongoException translateException(final Throwable t) { return (t instanceof MongoCommandException) ? checkForDuplicateKeyError((MongoCommandException) t) : MongoException.fromThrowable(t); }