DATAMONGO-1585 - Polishing.
Update documentation for better readability in html and pdf format. Original Pull Request: #433
This commit is contained in:
@@ -1739,9 +1739,14 @@ Note that one can also define fields with aliases via the static factory method
|
||||
====
|
||||
[source,java]
|
||||
----
|
||||
project("name", "netPrice") // will generate {$project: {name: 1, netPrice: 1}}
|
||||
project().and("foo").as("bar") // will generate {$project: {bar: $foo}}
|
||||
project("a","b").and("foo").as("bar") // will generate {$project: {a: 1, b: 1, bar: $foo}}
|
||||
// will generate {$project: {name: 1, netPrice: 1}}
|
||||
project("name", "netPrice")
|
||||
|
||||
// will generate {$project: {bar: $foo}}
|
||||
project().and("foo").as("bar")
|
||||
|
||||
// will generate {$project: {a: 1, b: 1, bar: $foo}}
|
||||
project("a","b").and("foo").as("bar")
|
||||
----
|
||||
====
|
||||
|
||||
@@ -1749,11 +1754,14 @@ project("a","b").and("foo").as("bar") // will generate {$project: {a: 1, b: 1, b
|
||||
====
|
||||
[source,java]
|
||||
----
|
||||
project("name", "netPrice"), sort(ASC, "name") // will generate {$project: {name: 1, netPrice: 1}}, {$sort: {name: 1}}
|
||||
// will generate {$project: {name: 1, netPrice: 1}}, {$sort: {name: 1}}
|
||||
project("name", "netPrice"), sort(ASC, "name")
|
||||
|
||||
project().and("foo").as("bar"), sort(ASC, "bar") // will generate {$project: {bar: $foo}}, {$sort: {bar: 1}}
|
||||
// will generate {$project: {bar: $foo}}, {$sort: {bar: 1}}
|
||||
project().and("foo").as("bar"), sort(ASC, "bar")
|
||||
|
||||
project().and("foo").as("bar"), sort(ASC, "foo") // this will not work
|
||||
// this will not work
|
||||
project().and("foo").as("bar"), sort(ASC, "foo")
|
||||
----
|
||||
====
|
||||
|
||||
|
||||
Reference in New Issue
Block a user