Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

upgraded mongo-java-driver to 2.10.0

  • Loading branch information...
commit 175d1cd11007f8632458f80b86b32e7575a15eb7 1 parent ee6fcab
@hoffrocket hoffrocket authored
View
2  README.md
@@ -45,7 +45,7 @@ Fongo uses a LinkedHashMap internally with the \_id as the key.
## Implementation Details
-Fongo depends on mockito to hijack the com.mongodb.Mongo class. It has a "provided" dependency on the mongo-java-driver and was tested with 2.9.3.
+Fongo depends on mockito to hijack the com.mongodb.Mongo class. It has a "provided" dependency on the mongo-java-driver and was tested with 2.10.0.
It also has a "provided" dependency on sl4j-api for logging. If you don't already have sl4j in your project, you can add a maven dependency to the logback implementation like this:
```
View
4 pom.xml
@@ -2,7 +2,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.foursquare</groupId>
<artifactId>fongo</artifactId>
- <version>1.0.4-SNAPSHOT</version>
+ <version>1.0.3-SNAPSHOT</version>
<name>fongo</name>
<description>Fake in-memory mongo</description>
<url>https://github.com/foursquare/fongo</url>
@@ -44,7 +44,7 @@
<dependency>
<groupId>org.mongodb</groupId>
<artifactId>mongo-java-driver</artifactId>
- <version>2.9.3</version>
+ <version>2.10.0</version>
<scope>provided</scope>
</dependency>
<dependency>
View
8 src/main/java/com/mongodb/FongoDBCollection.java
@@ -65,7 +65,11 @@ private CommandResult updateResult(int updateCount) {
@Override
public synchronized WriteResult insert(DBObject[] arr, WriteConcern concern, DBEncoder encoder) throws MongoException {
- for (DBObject obj : arr) {
+ return insert(Arrays.asList(arr), concern, encoder);
+ }
+
+ public WriteResult insert(List<DBObject> toInsert, WriteConcern concern, DBEncoder encoder) {
+ for (DBObject obj : toInsert) {
if (LOG.isDebugEnabled()) {
LOG.debug("insert: " + obj);
}
@@ -82,7 +86,7 @@ public synchronized WriteResult insert(DBObject[] arr, WriteConcern concern, DBE
putSizeCheck(id, obj);
}
}
- return new WriteResult(updateResult(arr.length), concern);
+ return new WriteResult(updateResult(toInsert.size()), concern);
}
boolean enforceDuplicates(WriteConcern concern) {
Please sign in to comment.
Something went wrong with that request. Please try again.