<commit_before>[![Build Status](https://travis-ci.org/krraghavan/mongodb-aggregate-query-support.svg)](https://travis-ci.org/krraghavan/mongodb-aggregate-query-support) [![Release Version](https://img.shields.io/badge/version-v0.7.13-red.svg)](https://github.com/krraghavan/mongodb-aggregate-query-support) [![License](https://img.shields.io/hexpm/l/plug.svg)](https://img.shields.io/hexpm/l/plug.svg)

# MONGO DB AGGREGATE QUERY SUPPORT
This module provides annotated support for MongoDB aggregate queries much like the @Query annotation provided by the 
Spring Data module.

The @Query annotation provided by Spring Data MongoDb allows queries to be executed with minimum code being written.  
It is highly desirable to have a similar mechanism for MongoDB aggregate queries which allow us to execute sophisticated
queries with practically no code being written.

## Current Limitations (Deprecated in v0.7.11)
Not all aggregate pipeline steps are supported.  As of 0.7.2 support is provided for
* Project
* Unwind
* Lookup
* Group
* Match
* Out
* Limit
* Bucket (Mongo 3.4+) - added in v0.7.2
* AddFields (Mongo 3.4+) - added in v0.7.2
* ReplaceRoot (Mongo 3.4+) - added in v0.7.2
* Facet (Mongo 3.4+) - added in v0.7.3
* Count - added in v0.7.4
* Skip - added in v0.7.9

## New in 0.7.13 version
1. Minor bug fix where conditionals were not getting ignored correctly in ```@Aggregate2``` annotated query pipelines

## New in 0.7.12 version
1. Facet pipeline stages and pipelines both support Conditional - entire pipelines or selected stages in a pipeline can
be excluded/included based on Conditions
2. Added support for query string or stages in ```FacetPipeline``` annotations.  ```query()``` and ```stages()``` are
mutually exclusive (query takes precedence)

## New in 0.7.11 version
A new set of Aggregate annotations have been created that allow the pipelines to be specified in their natural order by
leveraging Java 8 repeatable annotations.  Note that the order attribute is still required since the Java compiler 
puts all repeated annotations into their container without regard to their order in the method.  The primary purpose of
this enhancement is to improve readability of the query.  In addition to this, the specification of the Facet pipeline stage
has been changed to use nested annotations to specify the different pipeline stages.  The ```@FacetPipeline``` and 
```FacetPipelineStage``` can be used to specify multiple pipelines each with multiple stages (see unit tests for more details).
Finally, the Pageable support has been enhanced to support returning ```Page``` objects.  Users of this capability will now
 be able to get the total number of results that matched the query in addition to limiting the size of the results.

Notes
1. All annotations have the suffix 2 to distinguish them from the non-repeatable annotations - Example ```@Match2```
2. Pageable with Page return type is only supported with the new repeatable annotation
3. The non-repeatable annotations are being deprecated
4. Additional pipeline stages ```$sortByCount```, ```$graphLookup```, and ```$bucketAuto``` are supported (only in repeatable form)
Since these annotations were not supported in the previous releases, they do not have a suffix 2.<commit_msg>Remove bad 0.7.14 build changes.  Prepare for 0.7.15<commit_after>[![Build Status](https://travis-ci.org/krraghavan/mongodb-aggregate-query-support.svg)](https://travis-ci.org/krraghavan/mongodb-aggregate-query-support) [![Release Version](https://img.shields.io/badge/version-v0.7.13-red.svg)](https://github.com/krraghavan/mongodb-aggregate-query-support) [![License](https://img.shields.io/hexpm/l/plug.svg)](https://img.shields.io/hexpm/l/plug.svg)

# MONGO DB AGGREGATE QUERY SUPPORT
This module provides annotated support for MongoDB aggregate queries much like the @Query annotation provided by the 
Spring Data module.

The @Query annotation provided by Spring Data MongoDb allows queries to be executed with minimum code being written.  
It is highly desirable to have a similar mechanism for MongoDB aggregate queries which allow us to execute sophisticated
queries with practically no code being written.

## Current Limitations (Deprecated in v0.7.11)
Not all aggregate pipeline steps are supported.  As of 0.7.2 support is provided for
* Project
* Unwind
* Lookup
* Group
* Match
* Out
* Limit
* Bucket (Mongo 3.4+) - added in v0.7.2
* AddFields (Mongo 3.4+) - added in v0.7.2
* ReplaceRoot (Mongo 3.4+) - added in v0.7.2
* Facet (Mongo 3.4+) - added in v0.7.3
* Count - added in v0.7.4
* Skip - added in v0.7.9

## New in 0.7.15 version
Remove bad 0.7.14 build changes.
Add support for expressions in Document annotations

## New in 0.7.13 version
1. Minor bug fix where conditionals were not getting ignored correctly in ```@Aggregate2``` annotated query pipelines

## New in 0.7.12 version
1. Facet pipeline stages and pipelines both support Conditional - entire pipelines or selected stages in a pipeline can
be excluded/included based on Conditions
2. Added support for query string or stages in ```FacetPipeline``` annotations.  ```query()``` and ```stages()``` are
mutually exclusive (query takes precedence)

## New in 0.7.11 version
A new set of Aggregate annotations have been created that allow the pipelines to be specified in their natural order by
leveraging Java 8 repeatable annotations.  Note that the order attribute is still required since the Java compiler 
puts all repeated annotations into their container without regard to their order in the method.  The primary purpose of
this enhancement is to improve readability of the query.  In addition to this, the specification of the Facet pipeline stage
has been changed to use nested annotations to specify the different pipeline stages.  The ```@FacetPipeline``` and 
```FacetPipelineStage``` can be used to specify multiple pipelines each with multiple stages (see unit tests for more details).
Finally, the Pageable support has been enhanced to support returning ```Page``` objects.  Users of this capability will now
 be able to get the total number of results that matched the query in addition to limiting the size of the results.

Notes
1. All annotations have the suffix 2 to distinguish them from the non-repeatable annotations - Example ```@Match2```
2. Pageable with Page return type is only supported with the new repeatable annotation
3. The non-repeatable annotations are being deprecated
4. Additional pipeline stages ```$sortByCount```, ```$graphLookup```, and ```$bucketAuto``` are supported (only in repeatable form)
Since these annotations were not supported in the previous releases, they do not have a suffix 2.
{'fraction_non_alphanumeric': 0.08323353293413174, 'fraction_numerical': 0.02065868263473054, 'mean_word_length': 4.590794979079498, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 12, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4450590', 'n_tokens_mistral': 1927, 'n_tokens_neox': 1775, 'n_words': 868}