/** * Get the {@link WriteConcern} for this collection. * * @return the default write concern for this collection * @mongodb.driver.manual core/write-concern/ Write Concern */ public WriteConcern getWriteConcern() { if (writeConcern != null) { return writeConcern; } return database.getWriteConcern(); }
/** * Removes the specified user from the database. * * @param userName user to be removed * @return the result of executing this operation * @throws MongoException if the operation failed * @mongodb.driver.manual administration/security-access-control/ Access Control * @deprecated Use {@code DB.command} to call the dropUser command */ @Deprecated public WriteResult removeUser(final String userName) { try { executor.execute(new com.mongodb.operation.DropUserOperation(getName(), userName, getWriteConcern()), getReadConcern()); return new WriteResult(1, true, null); } catch (MongoWriteConcernException e) { throw createWriteConcernException(e); } }
/** * Drops this database. Removes all data on disk. Use with caution. * * @throws MongoException if the operation failed * @mongodb.driver.manual reference/command/dropDatabase/ Drop Database */ public void dropDatabase() { try { getExecutor().execute(new DropDatabaseOperation(getName(), getWriteConcern()), getReadConcern()); } catch (MongoWriteConcernException e) { throw createWriteConcernException(e); } }
/** * Gets the write concern. * * @return the writeConcern */ public WriteConcern getWriteConcern() { if (writeConcern == null) { return mongoDb.getWriteConcern(); } return writeConcern; }
executor.execute(new com.mongodb.operation.UpdateUserOperation(credential, readOnly, getWriteConcern()), getReadConcern()); return new WriteResult(1, true, null); } else { executor.execute(new com.mongodb.operation.CreateUserOperation(credential, readOnly, getWriteConcern()), getReadConcern()); return new WriteResult(1, false, null);
return new CreateCollectionOperation(getName(), collectionName, getWriteConcern()) .capped(capped) .collation(collation)
/** * Get the {@link WriteConcern} for this collection. * * @return the default write concern for this collection * @mongodb.driver.manual core/write-concern/ Write Concern */ public WriteConcern getWriteConcern() { if (writeConcern != null) { return writeConcern; } return database.getWriteConcern(); }
public DefaultMongoClientHolder(String dataSourceName, DB db) { this.dataSourceName = dataSourceName; this.db = db; this.concern = db.getWriteConcern(); }
/** * Gets the write concern. * * @return the writeConcern */ public WriteConcern getWriteConcern() { if (writeConcern == null) { return mongoDb.getWriteConcern(); } return writeConcern; }
/** * Removes the specified user from the database. * * @param userName user to be removed * @return the result of executing this operation * @throws MongoException if the operation failed * @mongodb.driver.manual administration/security-access-control/ Access Control * @deprecated Use {@code DB.command} to call the dropUser command */ @Deprecated public WriteResult removeUser(final String userName) { try { executor.execute(new com.mongodb.operation.DropUserOperation(getName(), userName, getWriteConcern()), getReadConcern()); return new WriteResult(1, true, null); } catch (MongoWriteConcernException e) { throw createWriteConcernException(e); } }
/** * Drops this database. Removes all data on disk. Use with caution. * * @throws MongoException if the operation failed * @mongodb.driver.manual reference/command/dropDatabase/ Drop Database */ public void dropDatabase() { try { getExecutor().execute(new DropDatabaseOperation(getName(), getWriteConcern()), getReadConcern()); } catch (MongoWriteConcernException e) { throw createWriteConcernException(e); } }
executor.execute(new com.mongodb.operation.UpdateUserOperation(credential, readOnly, getWriteConcern()), getReadConcern()); return new WriteResult(1, true, null); } else { executor.execute(new com.mongodb.operation.CreateUserOperation(credential, readOnly, getWriteConcern()), getReadConcern()); return new WriteResult(1, false, null);
return new CreateCollectionOperation(getName(), collectionName, getWriteConcern()) .capped(capped) .collation(collation)