DATAMONGO-745 - Added test cases for custom query with $in and pageable parameter.

Added test cases to verify that this works.

Original pull request: #186.
DATAMONGO-938 - Apply QueryMapper in MongoTemplate.mapReduce(…).

Previously MongoTemplate.mapReduce(...) didn't translate nested objects, e.g. GeoCommand, within the given query. That could lead to exceptions during query serialization. We now pass the query and sort object of the given Query through the QueryMapper to avoid such problems.

Original pull request: #184.
DATAMONGO-948 - Sort should be taken as is when no type information available.

Object type mapping for sort is skipped in the case no type information is present when executing query using mongo template.
DATAMONGO-949 - CycleGuard should only match properties in word boundaries.

We modified the regular expression used for cycle detection to match on the exact property name within the inspected path using word boundaries. This fix prevents sub sequences of an existing property (like ‘sub’ would have matched ‘substr’) from being matched.

Along the way we fixed the (false) assertion in one of the tests, as we create the +1 cycle reference index before actually breaking the operation.
DATAMONGO-952 - Derived queries should consider field specification in @Query.

PartTreeMongoQuery now explicitly check the presence of a manually defined field spec on the query method and creates a new Query if so.

Original pull request: #188.
DATAMONGO-958 - Switch to FieldNamingStrategy SPI in Spring Data Commons.
DATAMONGO-953 - Add equals(…)/hashCode()/toString() to Update.

We now use the underlying updateObject to implement appropriate equals(…)/hashCode() and toString() methods.

Original pull request: #192.
DATAMONGO-960 - Allow to pass options to the Aggregation Pipeline.

We introduced AggregationOptions abstraction to conveniently construct option objects that can be handed to an Aggregation via the new Aggregation.withOptions(...) factory method. For more details, see the Builder class' JavaDoc.

Note that we exposed the "rawResults" in AggregationResults and put a null guard in MongoTemplate aggregate in order to support the "explain" option.

Original pull request: #195.
DATAMONGO-950 - Add support for limiting the query result in the query derivation mechanism.

When deriving the query from its method name we check for the limit set on the PartTree to pass this on to the created query. PagedExecution not takes the overall limit into account, skips a query execution entirely (if the Pageable is out of scope completely) or alters the query limits accordingly.

Note, that there has been significant rework of this compared to the pull request to avoid new API in Query and extensive changes in MongoTemplate's QueryCursorPreparer.

Original pull request: #191.
DATAMONGO-963 - @CompoundIndex should treat expireAfterSeconds correctly.

We added an additional check on the fields used as key, so that TTL is ignored for CompoundIndex with more than one field (which effectively renders it useless on @CompoundIndex at all).

Prior to this change potentially invalid index structures would have been created for e.g. @CompoundIndex(def = "{'foo': 1, 'bar': 1}", expireAfterSeconds=10) leading to MongoDB not being able to clean up the indexes (logs: "ERROR: key for ttl index can only have 1 field")

This fix is related to https://jira.mongodb.org/browse/SERVER-10075.

Original pull request: #196.
DATAMONGO-954 - Add support for system variables in aggregation operations.

We now support referring to system variables like for instance $$ROOT or $$CURRENT from within aggregation framework pipeline projection and group expressions.

Original pull request: #190.
DATAMONGO-954 - Add support for system variables in aggregation operations.

Add assumes for appropriate MongoDB version.
DATAMONGO-970 - MongoTemplate.remove(…) now correctly builds query for DBObjects.

If a DBObject was handed into MongoTemplate.remove(…) we previously failed to look up the id value to create a by-id-query. This commit adds explicit handling of DBObjects by looking up their _id field to obtain the id value.
DATAMONGO-962 - Cycle guard should respect full path.

We now check on intersections of given path and existing to not only check types and contained property names but also properties full path which must not be present in already traversed paths.

Additionally we’ll now catch any CyclicPropertyReferenceExceptions on the root level to prevent cycle detection interfering with application startup.

Original pull request: #197.
DATAMONGO-955 - Updated changelog.
DATAMONGO-977 - Removed reflective detection of Spring 4 in DBRef proxy creation.

After the Spring 4 upgrade we can now directly use the Objenesis infrastructure of it.
DATAMONGO-978 - Derived delete query should pass on type information.

We now pass on type information for derived delete queries to the according delete operation. This propagates the information correctly to the according Before and After events.

Before this change the type would have been set to null in case of non collection like method return type.

Original pull request: #199.
DATAMONGO-937 - Add support for creating text index.

We now support creating text index based on information gathered on domain types.

Using @TextIndexed marks properties to be considered for the full text index. Use the weight attribute to influence document scoring during search operations.

Please note that using @TextIndexed on entity properties forces all properties of any sub document to be considered as part of the text index. Any set weight will in that case be propagated to the siblings taking the most recent weight information into account, which means that a the weight attribute can be overridden for properties in sub documents.

The setting the index default language can be done via @Document(language) while @Language can be used to define the language_override field.

As text search is disabled by default for mongodb 2.4 we use a jUnit ClassRule to restrict integration tests potentially creating text index (as the entities for testing are found in the classpath) to only be executed in when a 2.6+ mongodb server is present.

For usage hints please see section 6.3.4 (Text Indexes) of reference manual.

Original pull request: #198.
DATAMONGO-850 - Add support for full text search via $text

Using TextQuery and TextCriteria allows creation of queries using $text $search.

{ $meta : “textScore” } can be included using TextQuery.includeScore. As the fieldname used for textScore must not be fixed to “score” one can use the overload taking the fieldname to override the default.

Original pull request: #198.
DATAMONGO-976 - Add support for reading $meta projection on textScore into document.

We introduced @TextScore that can be used to mark a property to take { $meta : “textScore” }. In contrast to @Transient the value will be considered when reading documents.
The value can and will only get picked up if the score field is retrieved from the store.

Original pull request: #198.