Skip to content

Commit c1ac876

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

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
@@ -1685,21 +1685,29 @@ Note that one can also define fields with aliases via the static factory method
16851685
====
16861686
[source,java]
16871687
----
1688-
project("name", "netPrice") // will generate {$project: {name: 1, netPrice: 1}}
1689-
project().and("foo").as("bar") // will generate {$project: {bar: $foo}}
1690-
project("a","b").and("foo").as("bar") // will generate {$project: {a: 1, b: 1, bar: $foo}}
1688+
// will generate {$project: {name: 1, netPrice: 1}}
1689+
project("name", "netPrice")
1690+
1691+
// will generate {$project: {bar: $foo}}
1692+
project().and("foo").as("bar")
1693+
1694+
// will generate {$project: {a: 1, b: 1, bar: $foo}}
1695+
project("a","b").and("foo").as("bar")
16911696
----
16921697
====
16931698

16941699
.Multi-Stage Aggregation using Projection and Sorting
16951700
====
16961701
[source,java]
16971702
----
1698-
project("name", "netPrice"), sort(ASC, "name") // will generate {$project: {name: 1, netPrice: 1}}, {$sort: {name: 1}}
1703+
// will generate {$project: {name: 1, netPrice: 1}}, {$sort: {name: 1}}
1704+
project("name", "netPrice"), sort(ASC, "name")
16991705
1700-
project().and("foo").as("bar"), sort(ASC, "bar") // will generate {$project: {bar: $foo}}, {$sort: {bar: 1}}
1706+
// will generate {$project: {bar: $foo}}, {$sort: {bar: 1}}
1707+
project().and("foo").as("bar"), sort(ASC, "bar")
17011708
1702-
project().and("foo").as("bar"), sort(ASC, "foo") // this will not work
1709+
// this will not work
1710+
project().and("foo").as("bar"), sort(ASC, "foo")
17031711
----
17041712
====
17051713

0 commit comments

Comments
 (0)