Skip to content

Commit 437bf89

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

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
@@ -1739,21 +1739,29 @@ Note that one can also define fields with aliases via the static factory method
17391739
====
17401740
[source,java]
17411741
----
1742-
project("name", "netPrice") // will generate {$project: {name: 1, netPrice: 1}}
1743-
project().and("foo").as("bar") // will generate {$project: {bar: $foo}}
1744-
project("a","b").and("foo").as("bar") // will generate {$project: {a: 1, b: 1, bar: $foo}}
1742+
// will generate {$project: {name: 1, netPrice: 1}}
1743+
project("name", "netPrice")
1744+
1745+
// will generate {$project: {bar: $foo}}
1746+
project().and("foo").as("bar")
1747+
1748+
// will generate {$project: {a: 1, b: 1, bar: $foo}}
1749+
project("a","b").and("foo").as("bar")
17451750
----
17461751
====
17471752

17481753
.Multi-Stage Aggregation using Projection and Sorting
17491754
====
17501755
[source,java]
17511756
----
1752-
project("name", "netPrice"), sort(ASC, "name") // will generate {$project: {name: 1, netPrice: 1}}, {$sort: {name: 1}}
1757+
// will generate {$project: {name: 1, netPrice: 1}}, {$sort: {name: 1}}
1758+
project("name", "netPrice"), sort(ASC, "name")
17531759
1754-
project().and("foo").as("bar"), sort(ASC, "bar") // will generate {$project: {bar: $foo}}, {$sort: {bar: 1}}
1760+
// will generate {$project: {bar: $foo}}, {$sort: {bar: 1}}
1761+
project().and("foo").as("bar"), sort(ASC, "bar")
17551762
1756-
project().and("foo").as("bar"), sort(ASC, "foo") // this will not work
1763+
// this will not work
1764+
project().and("foo").as("bar"), sort(ASC, "foo")
17571765
----
17581766
====
17591767

0 commit comments

Comments
 (0)