marcesher / cfmongodb

MongoDB client wrapper for ColdFusion
89 stars 34 forks source link

aggregate() added to DBCollection.cfc #32

Closed sjdaniels closed 11 years ago

sjdaniels commented 12 years ago
marcesher commented 12 years ago

Sean, one thing I've learned about APIs like this is that it's best to not only return a subset of what the underlying driver gives you. In this case, you're returning just the results. However, I can certainly imagine legitimate situations where people would need the entire object. I'd recommend following the SearchResult and MapReduceResult approach that we're using in cfmongodb, and provide a new AggregationResult object that exposes all of what the java driver gives. In fact, you'll notice that in the existing cases, we actually return more than the Java driver... providing some convenience methods for the most common use cases

sjdaniels commented 12 years ago

Makes sense. I'll have a look tomorrow.