/** * Sets the write concern * * @param writeConcern the write concern * @return this */ public DeleteOptions writeConcern(final WriteConcern writeConcern) { options.writeConcern(writeConcern); return this; }
/** * Remove documents from a collection. * * @param query the deletion criteria using query operators. Omit the query parameter or pass an empty document to delete all * documents in the collection. * @param writeConcern {@code WriteConcern} to be used during operation * @return the result of the operation * @throws com.mongodb.WriteConcernException if the write failed due some other failure specific to the delete command * @throws MongoException if the operation failed for some other reason * @mongodb.driver.manual tutorial/remove-documents/ Remove Documents */ public WriteResult remove(final DBObject query, final WriteConcern writeConcern) { return remove(query, new DBCollectionRemoveOptions().writeConcern(writeConcern)); }
/** * Remove documents from a collection. * * @param query the deletion criteria using query operators. Omit the query parameter or pass an empty document to delete all * documents in the collection. * @param writeConcern {@code WriteConcern} to be used during operation * @param encoder {@code DBEncoder} to be used * @return the result of the operation * @throws com.mongodb.WriteConcernException if the write failed due some other failure specific to the delete command * @throws MongoException if the operation failed for some other reason * @mongodb.driver.manual tutorial/remove-documents/ Remove Documents */ public WriteResult remove(final DBObject query, final WriteConcern writeConcern, final DBEncoder encoder) { return remove(query, new DBCollectionRemoveOptions().writeConcern(writeConcern).encoder(encoder)); }
/** * Sets the write concern * * @param writeConcern the write concern * @return this */ public DeleteOptions writeConcern(final WriteConcern writeConcern) { options.writeConcern(writeConcern); return this; }
/** * Remove documents from a collection. * * @param query the deletion criteria using query operators. Omit the query parameter or pass an empty document to delete all * documents in the collection. * @param writeConcern {@code WriteConcern} to be used during operation * @return the result of the operation * @throws com.mongodb.WriteConcernException if the write failed due some other failure specific to the delete command * @throws MongoException if the operation failed for some other reason * @mongodb.driver.manual tutorial/remove-documents/ Remove Documents */ public WriteResult remove(final DBObject query, final WriteConcern writeConcern) { return remove(query, new DBCollectionRemoveOptions().writeConcern(writeConcern)); }
/** * Remove documents from a collection. * * @param query the deletion criteria using query operators. Omit the query parameter or pass an empty document to delete all * documents in the collection. * @param writeConcern {@code WriteConcern} to be used during operation * @param encoder {@code DBEncoder} to be used * @return the result of the operation * @throws com.mongodb.WriteConcernException if the write failed due some other failure specific to the delete command * @throws MongoException if the operation failed for some other reason * @mongodb.driver.manual tutorial/remove-documents/ Remove Documents */ public WriteResult remove(final DBObject query, final WriteConcern writeConcern, final DBEncoder encoder) { return remove(query, new DBCollectionRemoveOptions().writeConcern(writeConcern).encoder(encoder)); }