@@ -466,7 +466,9 @@ public WriteResult update(final DBObject query, final DBObject update, final boo
466
466
* @param bypassDocumentValidation whether to bypass document validation.
467
467
* @param encoder the DBEncoder to use
468
468
* @return the result of the operation
469
- * @throws MongoException
469
+ * @throws com.mongodb.DuplicateKeyException if the write failed to a duplicate unique key
470
+ * @throws com.mongodb.WriteConcernException if the write failed due some other failure specific to the update command
471
+ * @throws MongoException if the operation failed for some other reason
470
472
* @mongodb.driver.manual tutorial/modify-documents/ Modify
471
473
* @since 2.14
472
474
*/
@@ -1556,6 +1558,8 @@ public void setHintFields(final List<? extends DBObject> indexes) {
1556
1558
* @param sort determines which document the operation will modify if the query selects multiple documents
1557
1559
* @param update the modifications to apply
1558
1560
* @return pre-modification document
1561
+ * @throws WriteConcernException if the write failed due some other failure specific to the update command
1562
+ * @throws MongoException if the operation failed for some other reason
1559
1563
* @mongodb.driver.manual reference/command/findAndModify/ Find and Modify
1560
1564
*/
1561
1565
public DBObject findAndModify (final DBObject query , final DBObject sort , final DBObject update ) {
@@ -1569,6 +1573,8 @@ public DBObject findAndModify(final DBObject query, final DBObject sort, final D
1569
1573
* @param query specifies the selection criteria for the modification
1570
1574
* @param update the modifications to apply
1571
1575
* @return the document as it was before the modifications
1576
+ * @throws WriteConcernException if the write failed due some other failure specific to the update command
1577
+ * @throws MongoException if the operation failed for some other reason
1572
1578
* @mongodb.driver.manual reference/command/findAndModify/ Find and Modify
1573
1579
*/
1574
1580
public DBObject findAndModify (final DBObject query , final DBObject update ) {
@@ -1580,6 +1586,8 @@ public DBObject findAndModify(final DBObject query, final DBObject update) {
1580
1586
*
1581
1587
* @param query specifies the selection criteria for the modification
1582
1588
* @return the document as it was before the modifications
1589
+ * @throws WriteConcernException if the write failed due some other failure specific to the update command
1590
+ * @throws MongoException if the operation failed for some other reason
1583
1591
* @mongodb.driver.manual reference/command/findAndModify/ Find and Modify
1584
1592
*/
1585
1593
public DBObject findAndRemove (final DBObject query ) {
@@ -1599,6 +1607,8 @@ public DBObject findAndRemove(final DBObject query) {
1599
1607
* @param upsert when true, operation creates a new document if the query returns no documents
1600
1608
* @return the document as it was before the modifications, unless {@code returnNew} is true, in which case it returns the document
1601
1609
* after the changes were made
1610
+ * @throws WriteConcernException if the write failed due some other failure specific to the update command
1611
+ * @throws MongoException if the operation failed for some other reason
1602
1612
* @mongodb.driver.manual reference/command/findAndModify/ Find and Modify
1603
1613
*/
1604
1614
public DBObject findAndModify (final DBObject query , final DBObject fields , final DBObject sort ,
@@ -1621,7 +1631,8 @@ public DBObject findAndModify(final DBObject query, final DBObject fields, final
1621
1631
* @param writeConcern the write concern to apply to this operation
1622
1632
* @return the document as it was before the modifications, unless {@code returnNew} is true, in which case it returns the document
1623
1633
* after the changes were made
1624
- * @throws MongoException
1634
+ * @throws WriteConcernException if the write failed due some other failure specific to the update command
1635
+ * @throws MongoException if the operation failed for some other reason
1625
1636
* @since 2.14
1626
1637
* @mongodb.driver.manual reference/command/findAndModify/ Find and Modify
1627
1638
*/
@@ -1647,6 +1658,8 @@ public DBObject findAndModify(final DBObject query, final DBObject fields, final
1647
1658
* @param maxTimeUnit the unit that maxTime is specified in
1648
1659
* @return the document as it was before the modifications, unless {@code returnNew} is true, in which case it returns the document
1649
1660
* after the changes were made
1661
+ * @throws WriteConcernException if the write failed due some other failure specific to the update command
1662
+ * @throws MongoException if the operation failed for some other reason
1650
1663
* @mongodb.driver.manual reference/command/findAndModify/ Find and Modify
1651
1664
* @since 2.12.0
1652
1665
*/
@@ -1675,6 +1688,8 @@ public DBObject findAndModify(final DBObject query, final DBObject fields, final
1675
1688
* @param writeConcern the write concern to apply to this operation
1676
1689
* @return the document as it was before the modifications, unless {@code returnNew} is true, in which case it returns the document
1677
1690
* after the changes were made
1691
+ * @throws WriteConcernException if the write failed due some other failure specific to the update command
1692
+ * @throws MongoException if the operation failed for some other reason
1678
1693
* @mongodb.driver.manual reference/command/findAndModify/ Find and Modify
1679
1694
* @since 2.14.0
1680
1695
*/
@@ -1703,6 +1718,8 @@ public DBObject findAndModify(final DBObject query, final DBObject fields, final
1703
1718
* @param maxTimeUnit the unit that maxTime is specified in
1704
1719
* @return the document as it was before the modifications, unless {@code returnNew} is true, in which case it returns the document
1705
1720
* after the changes were made
1721
+ * @throws WriteConcernException if the write failed due some other failure specific to the update command
1722
+ * @throws MongoException if the operation failed for some other reason
1706
1723
* @mongodb.driver.manual reference/command/findAndModify/ Find and Modify
1707
1724
* @since 2.14.0
1708
1725
*/
@@ -1733,6 +1750,8 @@ public DBObject findAndModify(final DBObject query, final DBObject fields, final
1733
1750
* @param writeConcern the write concern to apply to this operation
1734
1751
* @return the document as it was before the modifications, unless {@code returnNew} is true, in which case it returns the document
1735
1752
* after the changes were made
1753
+ * @throws WriteConcernException if the write failed due some other failure specific to the update command
1754
+ * @throws MongoException if the operation failed for some other reason
1736
1755
* @mongodb.driver.manual reference/command/findAndModify/ Find and Modify
1737
1756
* @since 2.14.0
1738
1757
*/
0 commit comments