示例#1
0
        public SetWriteHook SetWriteHook(Javascript js)
        {
            Arguments arguments = new Arguments(this);

            arguments.CoerceAndAdd(js);
            return(new SetWriteHook(arguments));
        }
示例#2
0
/// <summary>
/// <para>Create a new secondary index on a table. Secondary indexes improve the speed of many read queries at the slight cost of increased storage space and decreased write performance. For more information about secondary indexes, read the article "<a href="/docs/secondary-indexes/">Using secondary indexes in RethinkDB</a>."</para>
/// </summary>
/// <example><para>Example: Create a simple index based on the field <code>postId</code>.</para>
/// <code>r.table('comments').indexCreate('postId').run(conn, callback)
/// </code></example>
        public IndexCreate IndexCreate(Object expr, Javascript js)
        {
            Arguments arguments = new Arguments(this);

            arguments.CoerceAndAdd(expr);
            arguments.CoerceAndAdd(js);
            return(new IndexCreate(arguments));
        }
/// <summary>
/// <para>Sums all the elements of a sequence.  If called with a field name,
/// sums all the values of that field in the sequence, skipping elements
/// of the sequence that lack that field.  If called with a function,
/// calls that function on every element of the sequence and sums the
/// results, skipping elements of the sequence where that function returns
/// <code>null</code> or a non-existence error.</para>
/// </summary>
/// <example><para>Example: What's 3 + 5 + 7?</para>
/// <code>r.expr([3, 5, 7]).sum().run(conn, callback)
/// </code></example>
                        public Sum sum ( Javascript js )
                        {
                        Arguments arguments = new Arguments(this);
                                arguments.CoerceAndAdd(js);
                        return new Sum (arguments );
                        }
/// <summary>
/// <para>Takes a stream and partitions it into multiple groups based on the
/// fields or functions provided.  Commands chained after <code>group</code> will be
/// called on each of these grouped sub-streams, producing grouped data.</para>
/// </summary>
/// <example><para>Example: What is each player's best game?</para>
/// <code>r.table('games').group('player').max('points').run(conn, callback)
/// </code></example>
                        public Group group ( Javascript js, Javascript jsA, Javascript jsB, Object exprA )
                        {
                        Arguments arguments = new Arguments(this);
                                arguments.CoerceAndAdd(js);
                                arguments.CoerceAndAdd(jsA);
                                arguments.CoerceAndAdd(jsB);
                                arguments.CoerceAndAdd(exprA);
                        return new Group (arguments );
                        }
/// <summary>
/// <para>Handle non-existence errors. Tries to evaluate and return its first argument. If an
/// error related to the absence of a value is thrown in the process, or if its first
/// argument returns <code>null</code>, returns its second argument. (Alternatively, the second argument
/// may be a function which will be called with either the text of the non-existence error
/// or <code>null</code>.)</para>
/// </summary>
/// <example><para>Example: Suppose we want to retrieve the titles and authors of the table <code>posts</code>.
/// In the case where the author field is missing or <code>null</code>, we want to retrieve the string
/// <code>Anonymous</code>.</para>
/// <code>r.table("posts").map( function(post) {
///     return {
///         title: post("title"),
///         author: post("author").default("Anonymous")
///     }
/// }).run(conn, callback)
/// </code></example>
                        public Default default_ ( Javascript js )
                        {
                        Arguments arguments = new Arguments(this);
                                arguments.CoerceAndAdd(js);
                        return new Default (arguments );
                        }
/// <summary>
/// <para>Loop over a sequence, evaluating the given write query for each element.</para>
/// </summary>
/// <example><para>Example: Now that our heroes have defeated their villains, we can safely remove them from the villain table.</para>
/// <code>r.table('marvel').forEach(function(hero) {
///     return r.table('villains').get(hero('villainDefeated')).delete()
/// }).run(conn, callback)
/// </code></example>
                        public ForEach forEach ( Javascript js )
                        {
                        Arguments arguments = new Arguments(this);
                                arguments.CoerceAndAdd(js);
                        return new ForEach (arguments );
                        }
 public Funcall do_ ( Javascript js )
 {
 Arguments arguments = new Arguments(this);
         arguments.CoerceAndAdd(js);
 return new Funcall (arguments );
 }
/// <summary>
/// <para>Update JSON documents in a table. Accepts a JSON document, a ReQL expression, or a
/// combination of the two. You can pass options like <code>returnChanges</code> that will return the old
/// and new values of the row you have modified.</para>
/// </summary>
/// <example><para>Example: Update the status of the post with <code>id</code> of <code>1</code> to <code>published</code>.</para>
/// <code>r.table("posts").get(1).update({status: "published"}).run(conn, callback)
/// </code></example>
                        public Update update ( Javascript js )
                        {
                        Arguments arguments = new Arguments(this);
                                arguments.CoerceAndAdd(js);
                        return new Update (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, Javascript js )
                        {
                        Arguments arguments = new Arguments(this);
                                arguments.CoerceAndAdd(exprA);
                                arguments.CoerceAndAdd(js);
                        return new OuterJoin (arguments );
                        }
示例#10
0
/// <summary>
/// <para>Merge two or more objects together to construct a new object with properties from all. When there is a conflict between field names, preference is given to fields in the rightmost object in the argument list.</para>
/// </summary>
/// <example><para>Example: Equip Thor for battle.</para>
/// <code>r.table('marvel').get('thor').merge(
///     r.table('equipment').get('hammer'),
///     r.table('equipment').get('pimento_sandwich')
/// ).run(conn, callback)
/// </code></example>
                        public Merge merge ( Javascript js )
                        {
                        Arguments arguments = new Arguments(this);
                                arguments.CoerceAndAdd(js);
                        return new Merge (arguments );
                        }
示例#11
0
 internal SetWriteHook setWriteHook(Javascript js)
 {
     return(SetWriteHook(js));
 }
示例#12
0
 internal IndexCreate indexCreate(Object expr, Javascript js)
 {
     return(IndexCreate(expr, js));
 }
示例#13
0
 internal Contains contains ( Object exprA, Javascript js, Object exprB )
 {
    return Contains ( exprA, js, exprB );
 }
示例#14
0
/// <summary>
/// <para>When called with values, returns <code>true</code> if a sequence contains all the
/// specified values.  When called with predicate functions, returns <code>true</code>
/// if for each predicate there exists at least one element of the stream
/// where that predicate returns <code>true</code>.</para>
/// </summary>
/// <example><para>Example: Has Iron Man ever fought Superman?</para>
/// <code>r.table('marvel').get('ironman')('opponents').contains('superman').run(conn, callback)
/// </code></example>
                        public Contains Contains ( Object exprA, Javascript js, Javascript jsA, Javascript jsB )
                        {
                            Arguments arguments = new Arguments(this);
                            arguments.CoerceAndAdd(exprA);
                            arguments.CoerceAndAdd(js);
                            arguments.CoerceAndAdd(jsA);
                            arguments.CoerceAndAdd(jsB);
                            return new Contains (arguments );
                        }
示例#15
0
/// <summary>
/// <para>Finds the maximum element of a sequence.</para>
/// </summary>
/// <example><para>Example: Return the maximum value in the list <code>[3, 5, 7]</code>.</para>
/// <code>r.expr([3, 5, 7]).max().run(conn, callback);
/// </code></example>
                        public Max max ( Javascript js )
                        {
                        Arguments arguments = new Arguments(this);
                                arguments.CoerceAndAdd(js);
                        return new Max (arguments );
                        }
示例#16
0
/// <summary>
/// <para>Merge two or more objects together to construct a new object with properties from all. When there is a conflict between field names, preference is given to fields in the rightmost object in the argument list.</para>
/// </summary>
/// <example><para>Example: Equip Thor for battle.</para>
/// <code>r.table('marvel').get('thor').merge(
///     r.table('equipment').get('hammer'),
///     r.table('equipment').get('pimento_sandwich')
/// ).run(conn, callback)
/// </code></example>
                        public Merge merge ( Javascript js, Javascript jsA, Javascript jsB, Object exprA )
                        {
                        Arguments arguments = new Arguments(this);
                                arguments.CoerceAndAdd(js);
                                arguments.CoerceAndAdd(jsA);
                                arguments.CoerceAndAdd(jsB);
                                arguments.CoerceAndAdd(exprA);
                        return new Merge (arguments );
                        }
示例#17
0
 internal Contains contains ( Javascript js, Object exprA, Object exprB, Object exprC )
 {
    return Contains ( js, exprA, exprB, exprC );
 }
示例#18
0
/// <summary>
/// <para>Merge two or more objects together to construct a new object with properties from all. When there is a conflict between field names, preference is given to fields in the rightmost object in the argument list.</para>
/// </summary>
/// <example><para>Example: Equip Thor for battle.</para>
/// <code>r.table('marvel').get('thor').merge(
///     r.table('equipment').get('hammer'),
///     r.table('equipment').get('pimento_sandwich')
/// ).run(conn, callback)
/// </code></example>
                        public Merge merge ( Object exprA, Object exprB, Object exprC, Javascript js )
                        {
                        Arguments arguments = new Arguments(this);
                                arguments.CoerceAndAdd(exprA);
                                arguments.CoerceAndAdd(exprB);
                                arguments.CoerceAndAdd(exprC);
                                arguments.CoerceAndAdd(js);
                        return new Merge (arguments );
                        }
示例#19
0
/// <summary>
/// <para>Join tables using a field or function on the left-hand sequence matching primary keys or secondary indexes on the right-hand table. <code>eqJoin</code> is more efficient than other ReQL join types, and operates much faster. Documents in the result set consist of pairs of left-hand and right-hand documents, matched when the field on the left-hand side exists and is non-null and an entry with that field's value exists in the specified index on the right-hand side.</para>
/// <para>Example: Match players with the games they've played against one another.</para>
/// <para><code>js
/// r.table('players').eqJoin('gameId', r.table('games')).run(conn, callback)</code></para>
/// </summary>
/// <example></example>
                        public EqJoin eqJoin ( Javascript js, Object exprA )
                        {
                        Arguments arguments = new Arguments(this);
                                arguments.CoerceAndAdd(js);
                                arguments.CoerceAndAdd(exprA);
                        return new EqJoin (arguments );
                        }
示例#20
0
/// <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 exprA, Object exprB, Javascript js )
                        {
                        Arguments arguments = new Arguments(this);
                                arguments.CoerceAndAdd(exprA);
                                arguments.CoerceAndAdd(exprB);
                                arguments.CoerceAndAdd(js);
                        return new Map (arguments );
                        }
示例#21
0
/// <summary>
/// <para>Replace documents in a table. Accepts a JSON document or a ReQL expression, and replaces
/// the original document with the new one. The new document must have the same primary key
/// as the original document.</para>
/// </summary>
/// <example><para>Example: Replace the document with the primary key <code>1</code>.</para>
/// <code>r.table("posts").get(1).replace({
///     id: 1,
///     title: "Lorem ipsum",
///     content: "Aleas jacta est",
///     status: "draft"
/// }).run(conn, callback)
/// </code></example>
                        public Replace replace ( Javascript js )
                        {
                        Arguments arguments = new Arguments(this);
                                arguments.CoerceAndAdd(js);
                        return new Replace (arguments );
                        }
示例#22
0
/// <summary>
/// <para>Get all the documents for which the given predicate is true.</para>
/// <para><code>filter</code> can be called on a sequence, selection, or a field containing an array of
/// elements. The return type is the same as the type on which the function was called on.</para>
/// <para>The body of every filter is wrapped in an implicit <code>.default(false)</code>, which means that
/// if a non-existence errors is thrown (when you try to access a field that does not exist
/// in a document), RethinkDB will just ignore the document.
/// The <code>default</code> value can be changed by passing an object with a <code>default</code> field.
/// Setting this optional argument to <code>r.error()</code> will cause any non-existence errors to
/// return a <code>RqlRuntimeError</code>.</para>
/// </summary>
/// <example><para>Example: Get all the users that are 30 years old.</para>
/// <code>r.table('users').filter({age: 30}).run(conn, callback)
/// </code></example>
                        public Filter filter ( Javascript js )
                        {
                        Arguments arguments = new Arguments(this);
                                arguments.CoerceAndAdd(js);
                        return new Filter (arguments );
                        }
示例#23
0
 public Funcall do_ ( Object exprA, Object exprB, Javascript js )
 {
 Arguments arguments = new Arguments(this);
         arguments.CoerceAndAdd(exprA);
         arguments.CoerceAndAdd(exprB);
         arguments.CoerceAndAdd(js);
 return new Funcall (arguments );
 }
示例#24
0
/// <summary>
/// <para>Concatenate one or more elements into a single sequence using a mapping function.</para>
/// </summary>
/// <example><para>Example: Construct a sequence of all monsters defeated by Marvel heroes. The field "defeatedMonsters" is an array of one or more monster names.</para>
/// <code>r.table('marvel').concatMap(function(hero) {
///     return hero('defeatedMonsters')
/// }).run(conn, callback)
/// </code></example>
                        public ConcatMap concatMap ( Javascript js )
                        {
                        Arguments arguments = new Arguments(this);
                                arguments.CoerceAndAdd(js);
                        return new ConcatMap (arguments );
                        }
示例#25
0
/// <summary>
/// <para>Returns whether or not a sequence contains all the specified values, or if functions are
/// provided instead, returns whether or not a sequence contains values matching all the
/// specified functions.</para>
/// </summary>
/// <example><para>Example: Has Iron Man ever fought Superman?</para>
/// <code>r.table('marvel').get('ironman')('opponents').contains('superman').run(conn, callback)
/// </code></example>
                        public Contains contains ( Javascript js, Javascript jsA, Javascript jsB, Javascript jsC )
                        {
                        Arguments arguments = new Arguments(this);
                                arguments.CoerceAndAdd(js);
                                arguments.CoerceAndAdd(jsA);
                                arguments.CoerceAndAdd(jsB);
                                arguments.CoerceAndAdd(jsC);
                        return new Contains (arguments );
                        }
示例#26
0
/// <summary>
/// <para>Sort the sequence by document values of the given key(s). To specify
/// the ordering, wrap the attribute with either <code>r.asc</code> or <code>r.desc</code>
/// (defaults to ascending).</para>
/// <para>Sorting without an index requires the server to hold the sequence in
/// memory, and is limited to 100,000 documents (or the setting of the <code>arrayLimit</code> option for <a href="/api/javascript/run">run</a>). Sorting with an index can
/// be done on arbitrarily large tables, or after a <code>between</code> command
/// using the same index.</para>
/// </summary>
/// <example><para>Example: Order all the posts using the index <code>date</code>.   </para>
/// <code>r.table('posts').orderBy({index: 'date'}).run(conn, callback)
/// </code>
/// <para>The index must have been previously created with <a href="/api/javascript/index_create/">indexCreate</a>.</para>
/// <code>r.table('posts').indexCreate('date').run(conn, callback)
/// </code>
/// <para>You can also select a descending ordering:</para>
/// <code>r.table('posts').orderBy({index: r.desc('date')}).run(conn, callback)
/// </code></example>
                        public OrderBy orderBy ( Javascript js, Javascript jsA, Javascript jsB, Javascript jsC )
                        {
                        Arguments arguments = new Arguments(this);
                                arguments.CoerceAndAdd(js);
                                arguments.CoerceAndAdd(jsA);
                                arguments.CoerceAndAdd(jsB);
                                arguments.CoerceAndAdd(jsC);
                        return new OrderBy (arguments );
                        }
示例#27
0
/// <summary>
/// <para>Takes a stream and partitions it into multiple groups based on the
/// fields or functions provided.  Commands chained after <code>group</code> will be
/// called on each of these grouped sub-streams, producing grouped data.</para>
/// </summary>
/// <example><para>Example: What is each player's best game?</para>
/// <code>r.table('games').group('player').max('points').run(conn, callback)
/// </code></example>
                        public Group group ( Javascript js )
                        {
                        Arguments arguments = new Arguments(this);
                                arguments.CoerceAndAdd(js);
                        return new Group (arguments );
                        }
示例#28
0
/// <summary>
/// <para>Sort the sequence by document values of the given key(s). To specify
/// the ordering, wrap the attribute with either <code>r.asc</code> or <code>r.desc</code>
/// (defaults to ascending).</para>
/// <para>Sorting without an index requires the server to hold the sequence in
/// memory, and is limited to 100,000 documents (or the setting of the <code>arrayLimit</code> option for <a href="/api/javascript/run">run</a>). Sorting with an index can
/// be done on arbitrarily large tables, or after a <code>between</code> command
/// using the same index.</para>
/// </summary>
/// <example><para>Example: Order all the posts using the index <code>date</code>.   </para>
/// <code>r.table('posts').orderBy({index: 'date'}).run(conn, callback)
/// </code>
/// <para>The index must have been previously created with <a href="/api/javascript/index_create/">indexCreate</a>.</para>
/// <code>r.table('posts').indexCreate('date').run(conn, callback)
/// </code>
/// <para>You can also select a descending ordering:</para>
/// <code>r.table('posts').orderBy({index: r.desc('date')}).run(conn, callback)
/// </code></example>
                        public OrderBy orderBy ( Object exprA, Object exprB, Object exprC, Javascript js )
                        {
                        Arguments arguments = new Arguments(this);
                                arguments.CoerceAndAdd(exprA);
                                arguments.CoerceAndAdd(exprB);
                                arguments.CoerceAndAdd(exprC);
                                arguments.CoerceAndAdd(js);
                        return new OrderBy (arguments );
                        }
示例#29
0
/// <summary>
/// <para>Takes a stream and partitions it into multiple groups based on the
/// fields or functions provided.  Commands chained after <code>group</code> will be
/// called on each of these grouped sub-streams, producing grouped data.</para>
/// </summary>
/// <example><para>Example: What is each player's best game?</para>
/// <code>r.table('games').group('player').max('points').run(conn, callback)
/// </code></example>
                        public Group group ( Object exprA, Object exprB, Object exprC, Javascript js )
                        {
                        Arguments arguments = new Arguments(this);
                                arguments.CoerceAndAdd(exprA);
                                arguments.CoerceAndAdd(exprB);
                                arguments.CoerceAndAdd(exprC);
                                arguments.CoerceAndAdd(js);
                        return new Group (arguments );
                        }
示例#30
0
/// <summary>
/// <para>Get the indexes of an element in a sequence. If the argument is a predicate, get the indexes of all elements matching it.</para>
/// </summary>
/// <example><para>Example: Find the position of the letter 'c'.</para>
/// <code>r.expr(['a','b','c']).offsetsOf('c').run(conn, callback)
/// </code></example>
                        public OffsetsOf offsetsOf ( Javascript js )
                        {
                        Arguments arguments = new Arguments(this);
                                arguments.CoerceAndAdd(js);
                        return new OffsetsOf (arguments );
                        }
示例#31
0
/// <summary>
/// <para>Averages all the elements of a sequence.  If called with a field name,
/// averages all the values of that field in the sequence, skipping
/// elements of the sequence that lack that field.  If called with a
/// function, calls that function on every element of the sequence and
/// averages the results, skipping elements of the sequence where that
/// function returns <code>null</code> or a non-existence error.</para>
/// </summary>
/// <example><para>Example: What's the average of 3, 5, and 7?</para>
/// <code>r.expr([3, 5, 7]).avg().run(conn, callback)
/// </code></example>
                        public Avg avg ( Javascript js )
                        {
                        Arguments arguments = new Arguments(this);
                                arguments.CoerceAndAdd(js);
                        return new Avg (arguments );
                        }
示例#32
0
/// <summary>
/// <para>Count the number of elements in the sequence. With a single argument, count the number
/// of elements equal to it. If the argument is a function, it is equivalent to calling
/// filter before count.</para>
/// </summary>
/// <example><para>Example: Just how many super heroes are there?</para>
/// <code>r.table('marvel').count().add(r.table('dc').count()).run(conn, callback)
/// </code></example>
                        public Count count ( Javascript js )
                        {
                        Arguments arguments = new Arguments(this);
                                arguments.CoerceAndAdd(js);
                        return new Count (arguments );
                        }
示例#33
0
/// <summary>
/// <para>Returns whether or not a sequence contains all the specified values, or if functions are
/// provided instead, returns whether or not a sequence contains values matching all the
/// specified functions.</para>
/// </summary>
/// <example><para>Example: Has Iron Man ever fought Superman?</para>
/// <code>r.table('marvel').get('ironman')('opponents').contains('superman').run(conn, callback)
/// </code></example>
                        public Contains contains ( Object exprA, Object exprB, Object exprC, Javascript js )
                        {
                        Arguments arguments = new Arguments(this);
                                arguments.CoerceAndAdd(exprA);
                                arguments.CoerceAndAdd(exprB);
                                arguments.CoerceAndAdd(exprC);
                                arguments.CoerceAndAdd(js);
                        return new Contains (arguments );
                        }
示例#34
0
 internal Max max ( Javascript js )
 {
    return Max ( js );
 }