Skip to content

Commit 90ae6d1

Browse files
DATAMONGO-1585 - Polishing.
Update documentation for better readability in html and pdf format. Original Pull Request: #433
1 parent 1fe79f1 commit 90ae6d1

File tree

1 file changed

+14
-6
lines changed

1 file changed

+14
-6
lines changed

src/main/asciidoc/reference/mongodb.adoc

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1741,21 +1741,29 @@ Note that one can also define fields with aliases via the static factory method
17411741
====
17421742
[source,java]
17431743
----
1744-
project("name", "netPrice") // will generate {$project: {name: 1, netPrice: 1}}
1745-
project().and("foo").as("bar") // will generate {$project: {bar: $foo}}
1746-
project("a","b").and("foo").as("bar") // will generate {$project: {a: 1, b: 1, bar: $foo}}
1744+
// will generate {$project: {name: 1, netPrice: 1}}
1745+
project("name", "netPrice")
1746+
1747+
// will generate {$project: {bar: $foo}}
1748+
project().and("foo").as("bar")
1749+
1750+
// will generate {$project: {a: 1, b: 1, bar: $foo}}
1751+
project("a","b").and("foo").as("bar")
17471752
----
17481753
====
17491754

17501755
.Multi-Stage Aggregation using Projection and Sorting
17511756
====
17521757
[source,java]
17531758
----
1754-
project("name", "netPrice"), sort(ASC, "name") // will generate {$project: {name: 1, netPrice: 1}}, {$sort: {name: 1}}
1759+
// will generate {$project: {name: 1, netPrice: 1}}, {$sort: {name: 1}}
1760+
project("name", "netPrice"), sort(ASC, "name")
17551761
1756-
project().and("foo").as("bar"), sort(ASC, "bar") // will generate {$project: {bar: $foo}}, {$sort: {bar: 1}}
1762+
// will generate {$project: {bar: $foo}}, {$sort: {bar: 1}}
1763+
project().and("foo").as("bar"), sort(ASC, "bar")
17571764
1758-
project().and("foo").as("bar"), sort(ASC, "foo") // this will not work
1765+
// this will not work
1766+
project().and("foo").as("bar"), sort(ASC, "foo")
17591767
----
17601768
====
17611769

0 commit comments

Comments
 (0)