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