本文整理汇总了C#中RethinkDb.Driver.Ast.Javascript类的典型用法代码示例。如果您正苦于以下问题:C# Javascript类的具体用法?C# Javascript怎么用?C# Javascript使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Javascript类属于RethinkDb.Driver.Ast命名空间,在下文中一共展示了Javascript类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: contains
internal Contains contains ( Javascript js, Object exprA, Object exprB, Object exprC )
{
return Contains ( js, exprA, exprB, exprC );
}
示例2: sum
/// <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 );
}
示例3: max
/// <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 );
}
示例4: default_
/// <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 );
}
示例5: group
/// <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 );
}
示例6: do_
public Funcall do_ ( Javascript js )
{
Arguments arguments = new Arguments(this);
arguments.CoerceAndAdd(js);
return new Funcall (arguments );
}
示例7: forEach
/// <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 );
}
示例8: map
/// <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 );
}
示例9: filter
/// <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 );
}
示例10: merge
/// <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 );
}
示例11: Contains
/// <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 );
}
示例12: update
/// <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 );
}
示例13: concatMap
/// <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 );
}
示例14: replace
/// <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 );
}
示例15: orderBy
/// <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 );
}