Comments (7)
Matthias Scudlik commented
group by (like sql) integration with min/max/sum etc. in the Criteria API would be very useful
from spring-data-mongodb.
Mark Pollack commented
looks like 1.9 will have this - http://jira.mongodb.org/browse/SERVER-447
from spring-data-mongodb.
Matthias Scudlik commented
Will this be added to the Criteria API, once 1.9 is out?
How do you handle that spring-document-mongodb is compatible to various mongodb versions?
from spring-data-mongodb.
Mark Pollack commented
I think we will add features into the API to track the latest releases, these would then fail on an older server. Documenting this seems enough for now I think, we could add some server number checks as well. FWIW, the aggregation framework was move to 2.1, due date is now in Oct 2011
from spring-data-mongodb.
Matthias Scudlik commented
I think you're right, but only with the new aggregation framework. All of these features can be done with map reduce as well i think. So the question is whether you can reverse engineer parts of it with map reduce
from spring-data-mongodb.
Mark Pollack commented
The API i'm thinking of implementing is looking like like what is in the C# driver.
<T> MapReduceResult<T> mapReduce(String map, String reduce, Class<T> entityClass )
<T> MapReduceResult<T> mapReduce(String map, String reduce, MapReduceOptions options, Class<T> entityClass )
<T> MapReduceResult<T> mapReduce(Query query, String map, String reduce, Class<T> entityClass)
<T> MapReduceResult<T> mapReduce(Query query, String map, String reduce, MapReduceOptions options, Class<T> entityClass)
where you can create MapReduceOptions in a fluent API style like this
public static MapReduceOptions options() { return new MapReduceOptions() } // possible pass in some common options in a ctor arg
public static MapReduceOutput replace(String collectionName) {
new MapReduceOutput...
}
options().output(MapReduceOutput.replace(collectionName))
options().output(replace(collectionName))
//default is replace
options().output(collectionName, databaseName))
options().output(collectionName)
options().finalize(finalize)
etc...
Strings will be attempted to be converted to a Spring resource URI so they can be picked up via the classpath or such this way map and reduce .js files can live separately.
Using an extended criteria API just for map reduce, e.g. min-max might be possible in that one could generate the .js files on the fly for simple cases. I'd need to play with it a bit more as the more I dig into it the more delicate it seems to provide a general solution.
What do you think?
from spring-data-mongodb.
Matthias Scudlik commented
I think this is a good solution. One can provide .js files for own UseCases but you also support the common functions like min and max.
Note:
You probably need some placeholders in the .js files
from spring-data-mongodb.
Related Issues (20)
- Release 4.2.6 (2023.1.6)
- Release 4.3 GA (2024.0.0)
- Regex criteria is not mapped to mongo query
- Aggregation/Aggregation Operations - equals() function is missing
- Using aggregation parameters with @Aggregation HOT 3
- `MongoTemplate.indexOps(collectionName, type)` ignores collectionName when type is not `null` HOT 1
- Release 4.2.7 (2023.1.7)
- Release 4.3.1 (2024.0.1)
- Release 4.4 M1 (2024.1.0)
- Aggregations should be able to handle `Sort.unsorted()` HOT 5
- Behavior of `$project` for nested documents HOT 1
- Use of arrayFilters in @Update in mongo repository HOT 1
- VectorSearch Aggregation Stage HOT 1
- Id conversion handling in `QueryMapper.getMappedValue(…)` doesn't consider nesting HOT 1
- Can't create CRaC checkpoint, fails with the error message "Restarting Spring-managed lifecycle beans after JVM restore" HOT 2
- `SpringDataMongodbQuery` and `SpringDataMongodbSerializer` apply mapping twice HOT 1
- Null-Values from custom converters are stored in document HOT 1
- SpringApplication.exit(...) not closing application due to MongoDB locks for cluster with multiple nodes
- Converter called multiple times evaluating aggregation operation query methods HOT 5
- Creating a Type-Safe Query with Kotlin for Document IDs that have a relationship with DBRef HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from spring-data-mongodb.