fakemongo/fongo — pull request #54 by nilstgmd (2014-07-15 08:03:27+00:00)
Title: Include upserted objects in writeresult.

This pull requests will upserted objects to count against the modified documents count (n). The mongo-java-driver will consider all updated and inserted objects of an upsert as _modified_ and therefore count it against the n.

Examples:
* update an existing record: `WriteResult#getN() == 1`
* upsert a non-existing record: `WriteResult#getN() == 1`
* update a non-existing record: `WriteResult#getN() == 0`

---

@twillouer please review, merge and delete the branch.