定义
MongoDB\UpdateResult::getMatchedCount()返回匹配的文档数。
function getMatchedCount(): integer 仅当写入已确认时才应调用此方法。
注意
如果更新/替换操作没有导致文档发生任何更改(例如 将字段的值设置为其当前值)时,匹配的计数可能大于
getModifiedCount()返回的值。
Return Values
匹配的文档数。
错误/异常
MongoDB\Exception\BadMethodCallException if this method is called and the write operation used an unacknowledged write concern.