DATAMONGO-1549 - Polishing $count (aggregation stage).

Original Pull Request: #422
This commit is contained in:
Christoph Strobl
2016-12-12 09:27:45 +01:00
parent 4c07235107
commit 1dea009e32
2 changed files with 7 additions and 9 deletions

View File

@@ -20,12 +20,12 @@ import org.springframework.data.mongodb.core.aggregation.ExposedFields.ExposedFi
import org.springframework.util.Assert;
/**
* Encapsulates the aggregation framework {@code $count}-operation.
* <p>
* We recommend to use the static factory method {@link Aggregation#count()} instead of creating instances of this
* class directly.
*
* @see https://docs.mongodb.com/manual/reference/operator/aggregation/count/#pipe._S_count
* Encapsulates the aggregation framework {@code $count}-operation. <br />
* We recommend to use the static factory method {@link Aggregation#count()} instead of creating instances of this class
* directly.
*
* @see <a href=
* "https://docs.mongodb.com/manual/reference/operator/aggregation/count/#pipe._S_count">https://docs.mongodb.com/manual/reference/operator/aggregation/count/</a>
* @author Mark Paluch
* @since 1.10
*/

View File

@@ -43,9 +43,7 @@ public class CountOperationUnitTests {
public void shouldRenderCorrectly() {
CountOperation countOperation = new CountOperation("field");
Document dbObject = countOperation.toDocument(Aggregation.DEFAULT_CONTEXT);
assertThat(dbObject, is(Document.parse("{$count : \"field\" }")));
assertThat(countOperation.toDocument(Aggregation.DEFAULT_CONTEXT), is(Document.parse("{$count : \"field\" }")));
}
/**