Browse Source

DATAMONGO-1585 - Polishing.

Update documentation for better readability in html and pdf format.

Original Pull Request: #433
pull/410/merge
Christoph Strobl 9 years ago
parent
commit
c1ac8767b7
  1. 20
      src/main/asciidoc/reference/mongodb.adoc

20
src/main/asciidoc/reference/mongodb.adoc

@ -1685,9 +1685,14 @@ Note that one can also define fields with aliases via the static factory method
==== ====
[source,java] [source,java]
---- ----
project("name", "netPrice") // will generate {$project: {name: 1, netPrice: 1}} // will generate {$project: {name: 1, netPrice: 1}}
project().and("foo").as("bar") // will generate {$project: {bar: $foo}} project("name", "netPrice")
project("a","b").and("foo").as("bar") // will generate {$project: {a: 1, b: 1, bar: $foo}}
// 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")
---- ----
==== ====
@ -1695,11 +1700,14 @@ project("a","b").and("foo").as("bar") // will generate {$project: {a: 1, b: 1, b
==== ====
[source,java] [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")
---- ----
==== ====

Loading…
Cancel
Save