But i get an exception on the substraction code. I think that only substractions between number is working.
java.lang.ClassCastException: java.util.Date cannot be cast to java.lang.Number
at com.github.fakemongo.impl.aggregation.Project$ProjectedToSubtract.unapply(Project.java:723)
at com.github.fakemongo.impl.aggregation.Project.apply(Project.java:879)
at com.github.fakemongo.impl.Aggregator.computeResult(Aggregator.java:48)
at com.mongodb.FongoDB.doAggregateCollection(FongoDB.java:114)
at com.mongodb.FongoDB.command(FongoDB.java:251)
at com.mongodb.DB.command(DB.java:507)
at com.mongodb.DB.command(DB.java:462)
at org.springframework.data.mongodb.core.MongoTemplate$3.doInDB(MongoTemplate.java:390)
at org.springframework.data.mongodb.core.MongoTemplate$3.doInDB(MongoTemplate.java:388)
at org.springframework.data.mongodb.core.MongoTemplate.execute(MongoTemplate.java:446)
at org.springframework.data.mongodb.core.MongoTemplate.executeCommand(MongoTemplate.java:388)
at org.springframework.data.mongodb.core.MongoTemplate.aggregate(MongoTemplate.java:1552)
at org.springframework.data.mongodb.core.MongoTemplate.aggregate(MongoTemplate.java:1487)
I have a collection who looks like that:
I'm trying to execute the following aggregation pipeline:
But i get an exception on the substraction code. I think that only substractions between number is working.
It's working with a real Mongod server.