/// <summary> /// <para>Transform each element of one or more sequences by applying a mapping function to them. If <code>map</code> is run with two or more sequences, it will iterate for as many items as there are in the shortest sequence.</para> ///</summary> /// <example><para>Example: Return the first five squares.</para> /// <code>r.expr([1, 2, 3, 4, 5]).map(function (val) { /// return val.mul(val); /// }).run(conn, callback); /// // Result passed to callback /// [1, 4, 9, 16, 25] /// </code></example> public Map map ( Object expr, Object exprA, ReqlFunction2 func2 ) { Arguments arguments = new Arguments(); arguments.CoerceAndAdd(expr); arguments.CoerceAndAdd(exprA); arguments.CoerceAndAdd(func2); return new Map (arguments); }
public Funcall do_ ( Object expr, Object exprA, ReqlFunction2 func2 ) { Arguments arguments = new Arguments(); arguments.CoerceAndAdd(expr); arguments.CoerceAndAdd(exprA); arguments.CoerceAndAdd(func2); return new Funcall (arguments); }
/// <summary> /// <para>Produce a single value from a sequence through repeated application of a reduction /// function.</para> /// </summary> /// <example><para>Example: Return the number of documents in the table `posts.</para> /// <code>r.table("posts").map(function(doc) { /// return 1 /// }).reduce(function(left, right) { /// return left.add(right) /// }).run(conn, callback); /// </code></example> public Reduce reduce ( ReqlFunction2 func2 ) { Arguments arguments = new Arguments(this); arguments.CoerceAndAdd(func2); return new Reduce (arguments ); }
/// <summary> /// <para>Returns a left outer join of two sequences.</para> /// </summary> /// <example><para>Example: Return a list of all Marvel heroes, paired with any DC heroes who could beat them in a fight.</para> /// <code>r.table('marvel').outerJoin(r.table('dc'), function(marvelRow, dcRow) { /// return marvelRow('strength').lt(dcRow('strength')) /// }).run(conn, callback) /// </code></example> public OuterJoin outerJoin ( Object exprA, ReqlFunction2 func2 ) { Arguments arguments = new Arguments(this); arguments.CoerceAndAdd(exprA); arguments.CoerceAndAdd(func2); return new OuterJoin (arguments ); }
internal OuterJoin outerJoin ( Object exprA, ReqlFunction2 func2 ) { return OuterJoin ( exprA, func2 ); }
internal Funcall do_ ( Object exprA, ReqlFunction2 func2 ) { return Do_ ( exprA, func2 ); }
internal Map map ( Object exprA, ReqlFunction2 func2 ) { return Map ( exprA, func2 ); }
internal InnerJoin innerJoin ( Object exprA, ReqlFunction2 func2 ) { return InnerJoin ( exprA, func2 ); }
internal Fold fold ( Object exprA, ReqlFunction2 func2 ) { return Fold ( exprA, func2 ); }
/// <summary> /// <para>Apply a function to a sequence in order, maintaining state via an accumulator. The <code>fold</code> command returns either a single value or a new sequence.</para> /// </summary> /// <example><para>Example: Concatenate words from a list.</para> /// <code>r.table('words').orderBy('id').fold('', function (acc, word) { /// return acc.add(r.branch(acc.eq(''), '', ', ')).add(word); /// }).run(conn, callback); /// </code> /// <para>(This example could be implemented with <code>reduce</code>, but <code>fold</code> will preserve the order when <code>words</code> is a RethinkDB table or other stream, which is not guaranteed with <code>reduce</code>.)</para></example> public Fold Fold ( Object exprA, ReqlFunction2 func2 ) { Arguments arguments = new Arguments(this); arguments.CoerceAndAdd(exprA); arguments.CoerceAndAdd(func2); return new Fold (arguments ); }
internal Reduce reduce ( ReqlFunction2 func2 ) { return Reduce ( func2 ); }
internal Reduce reduce ( Object expr, ReqlFunction2 func2 ) { return Reduce ( expr, func2 ); }
/// <summary> /// <para>Produce a single value from a sequence through repeated application of a reduction function.</para> ///</summary> /// <example><para>Example: Return the number of documents in the table <code>posts</code>.</para> /// <code>r.table("posts").map(function(doc) { /// return 1; /// }).reduce(function(left, right) { /// return left.add(right); /// }).default(0).run(conn, callback); /// </code> /// <para>A shorter way to execute this query is to use <a href="/api/javascript/count">count</a>.</para></example> public Reduce Reduce ( Object expr, ReqlFunction2 func2 ) { Arguments arguments = new Arguments(); arguments.CoerceAndAdd(expr); arguments.CoerceAndAdd(func2); return new Reduce (arguments); }