Skip to content

Commit

Permalink
0.7.13 release
Browse files Browse the repository at this point in the history
  • Loading branch information
Kollivakkam Raghavan committed May 3, 2017
1 parent 668bf03 commit 0041263
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[![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.12-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)
[![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
Expand All @@ -24,6 +24,9 @@ Not all aggregate pipeline steps are supported. As of 0.7.2 support is provided
* 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
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

<groupId>com.github.krraghavan</groupId>
<artifactId>mongodb-aggregate-query-support</artifactId>
<version>0.7.13-SNAPSHOT</version>
<version>0.7.13</version>

<name>Annotation based Mongo DB Aggregation Query Support</name>
<description>Spring Data @Query like support for Mongo Aggregation queries</description>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
import com.cisco.mongodb.aggregate.support.processor.ParameterPlaceholderReplacingContext;
import com.cisco.mongodb.aggregate.support.processor.PipelineStageQueryProcessor;
import org.apache.commons.lang3.ArrayUtils;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.springframework.core.annotation.AnnotationUtils;
import org.springframework.data.domain.Pageable;
Expand All @@ -43,6 +44,7 @@
import java.util.List;
import java.util.Map;

import static com.cisco.mongodb.aggregate.support.utils.ArrayUtils.NULL_STRING;
import static org.slf4j.LoggerFactory.getLogger;

/**
Expand Down Expand Up @@ -127,7 +129,10 @@ void createAggregateQuery() throws InvalidAggregationQueryException {
PipelineStageQueryProcessor queryProcessor = queryProcessorFactory.getQueryProcessor(context);
String query = queryProcessor.getQuery(context);
int index = queryProcessor.getOrder(context);
if (query != null && index >= 0) {
if (query != null && index >= 0 && !NULL_STRING.equals(query)) {
if (!StringUtils.isEmpty(queries[index])) {
LOGGER.warn("Two stages have the same order and the second one did not evaluate to a false condition");
}
queries[index] = query;
}
else if (query != null && index == -1) {
Expand Down

0 comments on commit 0041263

Please sign in to comment.