-
Type: Task
-
Resolution: Duplicate
-
Priority: Major - P3
-
None
-
Affects Version/s: 2.12.3
-
Component/s: API
-
Environment:RHEL 5.9 (open source) and 6.4 (enterprise server)
We are getting an error on our new enterprise server that does not appear on the open source version. We use the same code but change the pointer to the servers. Both servers are MongodB 2.6.4.
We are using Spring Data 1.6.0-RELEASE to load the MongoDB java driver.
When we execute an aggregation using only the $out operation we see using only the $out operator to copy the collection, we get an error (below). Here is the code:
// Get the collection
DBCollection sourceCollection = mongoOperations.getCollection(sourceCollectionName);
// Set up a pipeline
List<DBObject> ops = new ArrayList<DBObject>();
// Write to the target collection
ops.add(new BasicDBObject("$out", targetCollectionName));
// Do the copy
sourceCollection.aggregate(ops);
When the code runs, it makes sure the target collection does not exist.
Here is the important part of the error:
Caused by: java.lang.IllegalArgumentException: result undefined
at com.mongodb.AggregationOutput.<init>(AggregationOutput.java:80)
at com.mongodb.DBCollection.aggregate(DBCollection.java:1554)
at com.mongodb.DBCollection.aggregate(DBCollection.java:1532)
at com.bankofamerica.risk.aml.lms.service.ListService.copyCollection(ListService.java:978)
- duplicates
-
JAVA-1253 AggregationOutput should not throw IllegalArgumentException on command failure
- Closed