{
  "set_intersection": {
    "examples": [
      {
        "code": "r.table('marvel').get('IronMan')['equipment'].set_intersection(['newBoots', 'arc_reactor']).run(conn)", 
        "description": "<p><strong>Example:</strong> Check which pieces of equipment Iron Man has from a fixed list.</p>"
      }
    ], 
    "name": "set_intersection", 
    "io": [
      [
        "array", 
        "array"
      ]
    ], 
    "description": "\n\n\n\n\nIntersect two arrays returning values that occur in both of them as a set (an array with\ndistinct values).\n\n\n\n\n"
  }, 
  "db_create": {
    "examples": [
      {
        "code": "r.db_create('superheroes').run(conn)", 
        "description": "<p><strong>Example:</strong> Create a database named 'superheroes'.</p>"
      }
    ], 
    "name": "db_create", 
    "io": [
      [
        "r", 
        "object"
      ]
    ], 
    "description": "\n\n\n\nCreate a database. A RethinkDB database is a collection of tables, similar to\nrelational databases.\n\nIf successful, the operation returns an object: `{\"created\": 1}`. If a database with the\nsame name already exists the operation throws `RqlRuntimeError`.\nNote: that you can only use alphanumeric characters and underscores for the database name.\n\n\n\n\n"
  }, 
  "get_all": {
    "examples": [
      {
        "code": "r.table('marvel').get_all('man_of_steel', index='code_name').run(conn)", 
        "description": "<p><strong>Example:</strong> Secondary index keys are not guaranteed to be unique so we cannot query via\n\"get\" when using a secondary index.</p>"
      }, 
      {
        "code": "r.table('dc').get_all('superman').run(conn)", 
        "description": "<p><strong>Example:</strong> Without an index argument, we default to the primary index. While <code>get</code> will either return the document or <code>null</code> when no document with such a primary key value exists, this will return either a one or zero length stream.</p>"
      }, 
      {
        "code": "r.table('dc').get_all('superman', 'ant man').run(conn)", 
        "description": "<p><strong>Example:</strong> You can get multiple documents in a single call to <code>get_all</code>.</p>"
      }
    ], 
    "name": "get_all", 
    "io": [
      [
        "table", 
        "selection"
      ]
    ], 
    "description": "\n\n\n\nGet all documents where the given value matches the value of the requested index.\n\n\n\n\n\n\n"
  }, 
  "skip": {
    "examples": [
      {
        "code": "r.table('marvel').order_by('successMetric').skip(10).run(conn)", 
        "description": "<p><strong>Example:</strong> Here in conjunction with <code>order_by</code> we choose to ignore the most successful heroes.</p>"
      }
    ], 
    "name": "skip", 
    "io": [
      [
        "sequence", 
        "stream"
      ], 
      [
        "array", 
        "array"
      ]
    ], 
    "description": "\n\n\n\nSkip a number of elements from the head of the sequence.\n\n\n\n"
  }, 
  "delete_at": {
    "examples": [
      {
        "code": "r.expr([\"Iron Man\", \"Hulk\", \"Spider-Man\"]).delete_at(1).run(conn)", 
        "description": "<p><strong>Example:</strong> Hulk decides to leave the avengers.</p>"
      }, 
      {
        "code": "r.expr([\"Iron Man\", \"Hulk\", \"Thor\", \"Spider-Man\"]).delete_at(1,3).run(conn)", 
        "description": "<p><strong>Example:</strong> Hulk and Thor decide to leave the avengers.</p>"
      }
    ], 
    "name": "delete_at", 
    "io": [
      [
        "array", 
        "array"
      ]
    ], 
    "description": "\n\n\n\nRemove an element from an array at a given index. Returns the modified array.\n\n\n\n"
  }, 
  "month": {
    "examples": [
      {
        "code": "r.table(\"users\").filter(\n    r.row[\"birthdate\"].month() == 11\n)", 
        "description": "<p><strong>Example:</strong> Retrieve all the users who were born in November.</p>"
      }, 
      {
        "code": "r.table(\"users\").filter(\n    r.row[\"birthdate\"].month() == r.november\n)", 
        "description": "<p><strong>Example:</strong> Retrieve all the users who were born in November.</p>"
      }
    ], 
    "name": "month", 
    "io": [
      [
        "time", 
        "number"
      ]
    ], 
    "description": "\n\n\n\nReturn the month of a time object as a number between 1 and 12. For your convenience, the terms r.january, r.february etc. are defined and map to the appropriate integer.\n\n\n\n\n"
  }, 
  "reconnect": {
    "examples": [
      {
        "code": "conn.reconnect(noreply_wait=False)", 
        "description": "<p><strong>Example:</strong> Cancel outstanding requests/queries that are no longer needed.</p>"
      }
    ], 
    "name": "reconnect", 
    "io": [
      [
        "connection", 
        "undefined"
      ]
    ], 
    "description": "\n\n\n\nClose and reopen a connection. Closing a connection waits until all\noutstanding requests have finished.  If `noreply_wait` is set to\n`false`, all outstanding requests are canceled immediately.\n\n"
  }, 
  "index_drop": {
    "examples": [
      {
        "code": "r.table('dc').index_drop('code_name').run(conn)", 
        "description": "<p><strong>Example:</strong> Drop a secondary index named 'code_name'.</p>"
      }
    ], 
    "name": "index_drop", 
    "io": [
      [
        "table", 
        "object"
      ]
    ], 
    "description": "\n\n\n\nDelete a previously created secondary index of this table.\n\n\n"
  }, 
  "row": {
    "examples": [
      {
        "code": "r.table('users').filter(r.row['age'] > 5).run(conn)", 
        "description": "<p><strong>Example:</strong> Get all users whose age is greater than 5.</p>"
      }, 
      {
        "code": "r.table('users').filter(r.row['embedded_doc']['child'] > 5).run(conn)", 
        "description": "<p><strong>Example:</strong> Accessing the attribute 'child' of an embedded document.</p>"
      }, 
      {
        "code": "r.expr([1, 2, 3]).map(r.row + 1).run(conn)", 
        "description": "<p><strong>Example:</strong> Add 1 to every element of an array.</p>"
      }, 
      {
        "code": "r.table('users').filter(\n    lambda doc: doc['name'] == r.table('prizes').get('winner')\n).run(conn)", 
        "description": "<p><strong>Example:</strong> For nested queries functions should be used instead of r.row.</p>"
      }
    ], 
    "name": "row", 
    "io": [
      [
        "r", 
        "value"
      ]
    ], 
    "description": "\n\n\n\nReturns the currently visited document.\n\n\n\n\n\n\n\n\n"
  }, 
  "now": {
    "examples": [
      {
        "code": "r.table(\"users\").insert({\n    \"name\": \"John\",\n    \"subscription_date\": r.now()\n}).run(conn)", 
        "description": "<p><strong>Example:</strong> Add a new user with the time at which he subscribed.</p>"
      }
    ], 
    "name": "now", 
    "io": [
      [
        "r", 
        "time"
      ]
    ], 
    "description": "\n\n\n\nReturn a time object representing the current time in UTC. The command now() is computed once when the server receives the query, so multiple instances of r.now() will always return the same time inside a query.\n\n\n\n"
  }, 
  "day_of_year": {
    "examples": [
      {
        "code": "r.table(\"users\").filter(\n    r.row[\"birthdate\"].day_of_year() == 1\n).run(conn)", 
        "description": "<p><strong>Example:</strong> Retrieve all the users who were born the first day of a year.</p>"
      }
    ], 
    "name": "day_of_year", 
    "io": [
      [
        "time", 
        "number"
      ]
    ], 
    "description": "\n\n\n\nReturn the day of the year of a time object as a number between 1 and 366 (following ISO 8601 standard).\n\n\n\n\n"
  }, 
  "group_by": {
    "examples": [
      {
        "code": "r.table('marvel').group_by('weightClass', r.avg('strength')).run(conn)", 
        "description": "<p><strong>Example:</strong> Using a predefined reduction we can easily find the average strength of members of each weight class.</p>"
      }, 
      {
        "code": "r.table('marvel').group_by({'abilities' : {'primary' : True}}, r.avg('strength')).run(conn)", 
        "description": "<p><strong>Example:</strong> Groupings can also be specified on nested attributes.</p>"
      }, 
      {
        "code": "r.table('marvel').group_by({'abilities' : 'primary'}, r.avg('strength')).run(conn)", 
        "description": "<p><strong>Example:</strong> The nested syntax can quickly become verbose so there's a shortcut.</p>"
      }
    ], 
    "name": "group_by", 
    "io": [
      [
        "sequence", 
        "value"
      ]
    ], 
    "description": "\n\n\n\nGroups elements by the values of the given attributes and then applies the given\nreduction. Though similar to `groupedMapReduce`, `groupBy` takes a standardized object\nfor specifying the reduction. Can be used with a number of predefined common reductions.\n\n\n\n\n\n"
  }, 
  "index_status": {
    "examples": [
      {
        "code": "r.table('test').index_status().run(conn)", 
        "description": "<p><strong>Example:</strong> Get the status of all the indexes on <code>test</code>:</p>"
      }, 
      {
        "code": "r.table('test').index_status('timestamp').run(conn)", 
        "description": "<p><strong>Example:</strong> Get the status of the <code>timestamp</code> index:</p>"
      }
    ], 
    "name": "index_status", 
    "io": [
      [
        "table", 
        "array"
      ]
    ], 
    "description": "\n\n\n\nGet the status of the specified indexes on this table, or the status\nof all indexes on this table if no indexes are specified.\n\n\n"
  }, 
  "<": {
    "examples": [
      {
        "code": "(r.expr(2) < 2).run(conn)", 
        "description": "<p><strong>Example:</strong> Is 2 less than 2?</p>"
      }
    ], 
    "name": "<", 
    "io": [
      [
        "value", 
        "bool"
      ]
    ], 
    "description": "\n\n\n\nTest if the first value is less than other.\n\n\n"
  }, 
  "match": {
    "examples": [
      {
        "code": "r.table('users').filter(lambda row:row['name'].match(\"^A\")).run(conn)", 
        "description": "<p><strong>Example:</strong> Get all users whose name starts with A.</p>"
      }, 
      {
        "code": "r.expr('id:0,name:mlucy,foo:bar').match('name:(\\w+)')['groups'][0]['str'].run(conn)", 
        "description": "<p><strong>Example:</strong> Parse out a name (returns \"mlucy\").</p>"
      }, 
      {
        "code": "r.expr('id:0,foo:bar').match('name:(\\w+)')['groups'][0]['str'].run(conn)", 
        "description": "<p><strong>Example:</strong> Fail to parse out a name (returns null).</p>"
      }
    ], 
    "name": "match", 
    "io": [
      [
        "string", 
        "array"
      ]
    ], 
    "description": "\n\n\n\nMatch against a regular expression. Returns a match object containing the matched string,\nthat string's start/end position, and the capture groups. Accepts RE2 syntax\n([https://code.google.com/p/re2/wiki/Syntax](https://code.google.com/p/re2/wiki/Syntax)).\nYou can enable case-insensitive matching by prefixing the regular expression with\n`(?i)`. (See linked RE2 documentation for more flags.)\n\n\n\n\n\n"
  }, 
  "do": {
    "examples": [
      {
        "code": "r.do(r.table('marvel').get('IronMan'),\n    lambda ironman: ironman['name']).run(conn)", 
        "description": "<p><strong>Example:</strong> The object(s) passed to do() can be bound to name(s). The last argument is the expression to evaluate in the context of the bindings.</p>"
      }
    ], 
    "name": "do", 
    "io": [
      [
        "any", 
        "any"
      ]
    ], 
    "description": "\n\n\n\nEvaluate the expr in the context of one or more value bindings.\n\nThe type of the result is the type of the value returned from expr.\n\n\n\n"
  }, 
  "get": {
    "examples": [
      {
        "code": "r.table('marvel').get('superman').run(conn)", 
        "description": "<p><strong>Example:</strong> Find a document with the primary key 'superman'.</p>"
      }
    ], 
    "name": "get", 
    "io": [
      [
        "table", 
        "singleSelection"
      ]
    ], 
    "description": "\n\n\n\nGet a document by primary key.\n\n\n\n"
  }, 
  "==": {
    "examples": [
      {
        "code": "(r.expr(True) & False).run(conn)", 
        "description": "<p><strong>Example:</strong> True and false anded is false?</p>"
      }
    ], 
    "name": "==", 
    "io": [
      [
        "value", 
        "bool"
      ]
    ], 
    "description": "\n\n\n\nCompute the logical and of two values.\n\n"
  }, 
  "db": {
    "examples": [
      {
        "code": "r.db('heroes').table('marvel').run(conn)", 
        "description": "<p><strong>Example:</strong> Before we can query a table we have to select the correct database.</p>"
      }
    ], 
    "name": "db", 
    "io": [
      [
        "r", 
        "db"
      ]
    ], 
    "description": "\n\n\n\nReference a database.\n\n\n\n"
  }, 
  "index_list": {
    "examples": [
      {
        "code": "r.table('marvel').index_list().run(conn)", 
        "description": "<p><strong>Example:</strong> List the available secondary indexes for this table.</p>"
      }
    ], 
    "name": "index_list", 
    "io": [
      [
        "table", 
        "array"
      ]
    ], 
    "description": "\n\n\n\nList all the secondary indexes of this table.\n\n"
  }, 
  "repl": {
    "examples": [
      {
        "code": "r.connect(db='marvel').repl()\nr.table('heroes').run()", 
        "description": "<p><strong>Example:</strong> Set the default connection for the REPL, then call\n<code>run()</code> without specifying the connection.</p>"
      }
    ], 
    "name": "repl", 
    "io": [
      [
        null, 
        null
      ]
    ], 
    "description": "<p>Set the default connection to make REPL use easier. Allows calling\n<code>.run()</code> on queries without specifying a connection.</p>\n<p>Connection objects are not thread-safe and REPL connections should not\nbe used in multi-threaded environments.</p>"
  }, 
  "insert": {
    "examples": [
      {
        "code": "r.table('marvel').insert(\n    { 'superhero': 'Iron Man', 'superpower':'Arc Reactor' }).run(conn)", 
        "description": "<p><strong>Example:</strong> Insert a row into a table named 'marvel'.</p>"
      }, 
      {
        "code": "r.table('marvel').insert([\n    { 'superhero': 'Wolverine', 'superpower': 'Adamantium' },\n    { 'superhero': 'Spiderman', 'superpower': 'spidy sense' }\n    ], durability='soft'\n).run(conn)", 
        "description": "<p><strong>Example:</strong> Insert multiple rows into a table named 'marvel'. Also, specify that only\nsoft durability is required.</p>"
      }, 
      {
        "code": "r.table('marvel').insert(\n    { 'superhero': 'Iron Man', 'superpower': 'Arc Reactor' },\n    upsert=True\n).run(conn)", 
        "description": "<p><strong>Example:</strong> Insert a row into a table named 'marvel', overwriting if the document already exists.</p>"
      }, 
      {
        "code": "r.table('marvel').insert(\n    { 'superhero': 'Iron Man', 'superpower': 'Arc Reactor' },\n    upsert=True, return_vals=True\n).run(conn)", 
        "description": "<p><strong>Example:</strong> Get back a copy of the new row, this is useful if you've done an upsert or generated an ID.</p>"
      }
    ], 
    "name": "insert", 
    "io": [
      [
        "table", 
        "object"
      ], 
      [
        "selection", 
        "object"
      ], 
      [
        "singleSelection", 
        "object"
      ]
    ], 
    "description": "\n\n\n\n\nInsert JSON documents into a table. Accepts a single JSON document or an array of\ndocuments.\n\nInsert returns an object that contains the following attributes:\n\n- `inserted`: the number of documents that were succesfully inserted\n- `replaced`: the number of documents that were updated when upsert is used\n- `unchanged`: the number of documents that would have been modified, except that the\nnew value was the same as the old value when doing an upsert\n- `errors`: the number of errors encountered while inserting; if errors where\nencountered while inserting, `first_error` contains the text of the first error\n- `generated_keys`: a list of generated primary key values\n- `deleted` and `skipped`: 0 for an insert operation.\n\n\n\n\n\n\n"
  }, 
  "during": {
    "examples": [
      {
        "code": "r.table(\"posts\").filter(\n    r.row['date'].during(r.time(2013, 12, 1, \"Z\"), r.time(2013, 12, 10, \"Z\"))\n).run(conn)", 
        "description": "<p><strong>Example:</strong> Retrieve all the posts that were posted between December 1st, 2013 (inclusive) and December 10th, 2013 (exclusive).</p>"
      }, 
      {
        "code": "r.table(\"posts\").filter(\n    r.row['date'].during(r.time(2013, 12, 1, \"Z\"), r.time(2013, 12, 10, \"Z\"), left_bound=\"open\", right_bound=\"closed\")\n).run(conn)", 
        "description": "<p><strong>Example:</strong> Retrieve all the posts that were posted between December 1st, 2013 (exclusive) and December 10th, 2013 (inclusive).</p>"
      }
    ], 
    "name": "during", 
    "io": [
      [
        "time", 
        "bool"
      ]
    ], 
    "description": "\n\n\n\nReturn if a time is between two other times (by default, inclusive for the start, exclusive for the end).\n\n\n\n\n"
  }, 
  "difference": {
    "examples": [
      {
        "code": "r.table('marvel').get('IronMan')['equipment'].difference(['Boots']).run(conn)", 
        "description": "<p><strong>Example:</strong> Retrieve Iron Man's equipment list without boots.</p>"
      }
    ], 
    "name": "difference", 
    "io": [
      [
        "array", 
        "array"
      ]
    ], 
    "description": "\n\n\n\nRemove the elements of one array from another array.\n\n\n\n"
  }, 
  "day": {
    "examples": [
      {
        "code": "r.table(\"users\").filter(\n    r.row[\"birthdate\"].day() == 24\n)", 
        "description": "<p><strong>Example:</strong> Return the users born on the 24th of any month.</p>"
      }
    ], 
    "name": "day", 
    "io": [
      [
        "time", 
        "number"
      ]
    ], 
    "description": "\n\n\n\nReturn the day of a time object as a number between 1 and 31.\n\n\n\n"
  }, 
  "insert_at": {
    "examples": [
      {
        "code": "r.expr([\"Iron Man\", \"Spider-Man\"]).insert_at(1, \"Hulk\").run(conn)", 
        "description": "<p><strong>Example:</strong> Hulk decides to join the avengers.</p>"
      }
    ], 
    "name": "insert_at", 
    "io": [
      [
        "array", 
        "array"
      ]
    ], 
    "description": "\n\n\n\nInsert a value in to an array at a given index. Returns the modified array.\n\n\n\n"
  }, 
  "noreply_wait": {
    "examples": [
      {
        "code": "conn.noreply_wait()", 
        "description": "<p><strong>Example:</strong> We have previously run queries with the <code>noreply</code> argument set to <code>True</code>. Now\nwait until the server has processed them.</p>"
      }
    ], 
    "name": "noreply_wait", 
    "io": [
      [
        "connection", 
        null
      ]
    ], 
    "description": "\n\n\n\n`noreply_wait` ensures that previous queries with the `noreply` flag have been processed\nby the server. Note that this guarantee only applies to queries run on the given connection.\n\n\n"
  }, 
  "indexes_of": {
    "examples": [
      {
        "code": "r.expr(['a','b','c']).indexes_of('c').run(conn)", 
        "description": "<p><strong>Example:</strong> Find the position of the letter 'c'.</p>"
      }, 
      {
        "code": "r.table('marvel').union(r.table('dc')).order_by('popularity').indexes_of(\n    r.row['superpowers'].contains('invisibility')\n).run(conn)", 
        "description": "<p><strong>Example:</strong> Find the popularity ranking of invisible heroes.</p>"
      }
    ], 
    "name": "indexes_of", 
    "io": [
      [
        "sequence", 
        "array"
      ]
    ], 
    "description": "\n\n\n\n\nGet the indexes of an element in a sequence. If the argument is a predicate, get the indexes of all elements matching it.\n\n\n\n"
  }, 
  "merge": {
    "examples": [
      {
        "code": "r.table('marvel').get('IronMan').merge(\n    r.table('loadouts').get('alienInvasionKit')\n).run(conn)", 
        "description": "<p><strong>Example:</strong> Equip IronMan for battle.</p>"
      }, 
      {
        "code": "r.expr({'weapons' : {'spectacular graviton beam' : {'dmg' : 10, 'cooldown' : 20}}}).merge(\n    {'weapons' : {'spectacular graviton beam' : {'dmg' : 10}}}\n).run(conn)", 
        "description": "<p><strong>Example:</strong> Merge can be used recursively to modify object within objects.</p>"
      }, 
      {
        "code": "r.expr({'weapons' : {'spectacular graviton beam' : {'dmg' : 10, 'cooldown' : 20}}}).merge(\n    {'weapons' : r.literal({'repulsor rays' : {'dmg' : 3, 'cooldown' : 0}})}\n).run(conn)", 
        "description": "<p><strong>Example:</strong> To replace a nested object with another object you can use the literal keyword.</p>"
      }, 
      {
        "code": "r.expr({'weapons' : {'spectacular graviton beam' : {'dmg' : 10, 'cooldown' : 20}}}).merge(\n    {'weapons' : {'spectacular graviton beam' : r.literal()}}\n).run(conn)", 
        "description": "<p><strong>Example:</strong> Literal can be used to remove keys from an object as well.</p>"
      }
    ], 
    "name": "merge", 
    "io": [
      [
        "sequence", 
        "stream"
      ], 
      [
        "array", 
        "array"
      ], 
      [
        "object", 
        "object"
      ], 
      [
        "singleSelection", 
        "object"
      ]
    ], 
    "description": "\n\n\n\nMerge two objects together to construct a new object with properties from both. Gives preference to attributes from other when there is a conflict.\n\n\n\n\n\n\n\n"
  }, 
  "|": {
    "examples": [
      {
        "code": "(r.expr(True) & False).run(conn)", 
        "description": "<p><strong>Example:</strong> True and false anded is false?</p>"
      }
    ], 
    "name": "|", 
    "io": [
      [
        "bool", 
        "bool"
      ]
    ], 
    "description": "\n\n\n\nCompute the logical and of two values.\n\n"
  }, 
  "db_drop": {
    "examples": [
      {
        "code": "r.db_drop('superheroes').run(conn)", 
        "description": "<p><strong>Example:</strong> Drop a database named 'superheroes'.</p>"
      }
    ], 
    "name": "db_drop", 
    "io": [
      [
        "r", 
        "object"
      ]
    ], 
    "description": "\n\n\n\nDrop a database. The database, all its tables, and corresponding data will be deleted.\n\nIf successful, the operation returns the object `{\"dropped\": 1}`. If the specified database\ndoesn't exist a `RqlRuntimeError` is thrown.\n\n\n\n"
  }, 
  "coerce_to": {
    "examples": [
      {
        "code": "r.table('marvel').coerce_to('array').run(conn)", 
        "description": "<p><strong>Example:</strong> Convert a table to an array.</p>"
      }, 
      {
        "code": "r.expr([['name', 'Ironman'], ['victories', 2000]]).coerce_to('object').run(conn)", 
        "description": "<p><strong>Example:</strong> Convert an array of pairs into an object.</p>"
      }, 
      {
        "code": "r.expr(1).coerce_to('string').run(conn)", 
        "description": "<p><strong>Example:</strong> Convert a number to a string.</p>"
      }
    ], 
    "name": "coerce_to", 
    "io": [
      [
        "sequence", 
        "array"
      ], 
      [
        "value", 
        "string"
      ], 
      [
        "array", 
        "object"
      ], 
      [
        "object", 
        "array"
      ]
    ], 
    "description": "\n\n\n\nConverts a value of one type into another.\n\nYou can convert: a selection, sequence, or object into an ARRAY, an array of pairs into an OBJECT, and any DATUM into a STRING.\n\n\n\n\n\n"
  }, 
  "reduce": {
    "examples": [
      {
        "code": "r.table('marvel').map(r.row['monstersKilled']).reduce(\n    lambda acc, val: acc + val, 0).run(conn)", 
        "description": "<p><strong>Example:</strong> How many enemies have our heroes defeated?</p>"
      }
    ], 
    "name": "reduce", 
    "io": [
      [
        "sequence", 
        "value"
      ]
    ], 
    "description": "\n\n\n\nProduce a single value from a sequence through repeated application of a reduction\nfunction.\n\nThe reduce function gets invoked repeatedly not only for the input values but also for\nresults of previous reduce invocations. The type and format of the object that is passed\nin to reduce must be the same with the one returned from reduce.\n\n"
  }, 
  "sync": {
    "examples": [
      {
        "code": "r.table('marvel').sync().run(conn)", 
        "description": "<p><strong>Example:</strong> After having updated multiple heroes with soft durability, we now want to wait\nuntil these changes are persisted.</p>"
      }
    ], 
    "name": "sync", 
    "io": [
      [
        "table", 
        "object"
      ]
    ], 
    "description": "\n\n\n\n`sync` ensures that writes on a given table are written to permanent storage. Queries\nthat specify soft durability (`durability='soft'`) do not give such guarantees, so\n`sync` can be used to ensure the state of these queries. A call to `sync` does not return\nuntil all previous writes to the table are persisted.\n\nIf successful, the operation returns an object: `{\"synced\": 1}`.\n\n\n\n"
  }, 
  "connect": {
    "examples": [
      {
        "code": "conn = r.connect(db='marvel')", 
        "description": "<p><strong>Example:</strong> Opens a connection using the default host and port but\nspecifying the default database.</p>"
      }
    ], 
    "name": "connect", 
    "io": [
      [
        "r", 
        "undefined"
      ]
    ], 
    "description": "\n\n\n\nCreate a new connection to the database server. The keyword arguments are:\n\n- `host`: host of the RethinkDB instance. The default value is `localhost`.\n- `port`: the driver port, by default `28015`.\n- `db`: the database used if not explicitly specified in a query, by default `test`.\n- `auth_key`: the authentification key, by default the empty string.\n- `timeout`: timeout period for the connection to be opened, by default `20` (seconds).\n\n\nCreate a new connection to the database server.\n\nIf the connection cannot be established, a `RqlDriverError` exception\nwill be thrown.\n\n"
  }, 
  "year": {
    "examples": [
      {
        "code": "r.table(\"users\").filter(lambda user:\n    user[\"birthdate\"].year() == 1986\n).run(conn)", 
        "description": "<p><strong>Example:</strong> Retrieve all the users born in 1986.</p>"
      }
    ], 
    "name": "year", 
    "io": [
      [
        "time", 
        "number"
      ]
    ], 
    "description": "\n\n\n\nReturn the year of a time object.\n\n\n\n"
  }, 
  "close": {
    "examples": [
      {
        "code": "conn.close()", 
        "description": "<p><strong>Example:</strong> Close an open connection, waiting for noreply writes to finish.</p>"
      }, 
      {
        "code": "conn.close(noreply_wait=False)", 
        "description": "<p><strong>Example:</strong> Close an open connection immediately.</p>"
      }
    ], 
    "name": "close", 
    "io": [
      [
        "connection", 
        "undefined"
      ]
    ], 
    "description": "\n\n\n\n\nClose an open connection. Closing a connection waits until all\noutstanding requests have finished and then frees any open resources\nassociated with the connection.  If `noreply_wait` is set to `false`,\nall outstanding requests are canceled immediately.\n\nClosing a connection cancels all outstanding requests and frees the\nmemory associated with any open cursors.\n\n\n"
  }, 
  "db_list": {
    "examples": [
      {
        "code": "r.db_list().run(conn)", 
        "description": "<p><strong>Example:</strong> List all databases.</p>"
      }
    ], 
    "name": "db_list", 
    "io": [
      [
        "r", 
        "object"
      ]
    ], 
    "description": "\n\n\n\nList all database names in the system. The result is a list of strings.\n\n\n\n"
  }, 
  "append": {
    "examples": [
      {
        "code": "r.table('marvel').get('IronMan')['equipment'].append('newBoots').run(conn)", 
        "description": "<p><strong>Example:</strong> Retrieve Iron Man's equipment list with the addition of some new boots.</p>"
      }
    ], 
    "name": "append", 
    "io": [
      [
        "array", 
        "array"
      ]
    ], 
    "description": "\n\n\n\nAppend a value to an array.\n\n\n\n"
  }, 
  "outer_join": {
    "examples": [
      {
        "code": "r.table('marvel').outer_join(r.table('dc'),\n  lambda marvelRow, dcRow: marvelRow['strength'] < dcRow['strength']).run(conn)", 
        "description": "<p><strong>Example:</strong> Construct a sequence of documents containing all cross-universe matchups\nwhere a marvel hero would lose, but keep marvel heroes who would never lose a matchup in\nthe sequence.</p>"
      }
    ], 
    "name": "outer_join", 
    "io": [
      [
        "sequence", 
        "stream"
      ], 
      [
        "array", 
        "array"
      ]
    ], 
    "description": "\n\n\n\nComputes a left outer join by retaining each row in the left table even if no match was\nfound in the right table.\n\n\n\n"
  }, 
  "epoch_time": {
    "examples": [
      {
        "code": "r.table(\"user\").get(\"John\").update({\"birthdate\": r.epoch_time(531360000)}).run(conn)", 
        "description": "<p><strong>Example:</strong> Update the birthdate of the user \"John\" to November 3rd, 1986.</p>"
      }
    ], 
    "name": "epoch_time", 
    "io": [
      [
        "r", 
        "time"
      ]
    ], 
    "description": "\n\n\n\nCreate a time object based on seconds since epoch. The first argument is a double and\nwill be rounded to three decimal places (millisecond-precision).\n\n\n\n"
  }, 
  "+": {
    "examples": [
      {
        "code": "(r.expr(2) + 2).run(conn)", 
        "description": "<p><strong>Example:</strong> It's as easy as 2 + 2 = 4.</p>"
      }, 
      {
        "code": "(r.expr(\"foo\") + \"bar\").run(conn)", 
        "description": "<p><strong>Example:</strong> Strings can be concatenated too.</p>"
      }, 
      {
        "code": "(r.expr([\"foo\", \"bar\"]) + [\"buzz\"]).run(conn)", 
        "description": "<p><strong>Example:</strong> Arrays can be concatenated too.</p>"
      }, 
      {
        "code": "r.now() + 365*24*60*60", 
        "description": "<p><strong>Example:</strong> Create a date one year from now.</p>"
      }
    ], 
    "name": "+", 
    "io": [
      [
        "number", 
        "number"
      ], 
      [
        "string", 
        "string"
      ], 
      [
        "array", 
        "array"
      ], 
      [
        "time", 
        "time"
      ], 
      [
        "time", 
        "number"
      ]
    ], 
    "description": "\n\n\n\nSum two numbers, concatenate two strings, or concatenate 2 arrays.\n\n\n\n\n\n\n\n\n"
  }, 
  "for_each": {
    "examples": [
      {
        "code": "r.table('marvel').for_each(\n    lambda hero: r.table('villains').get(hero['villainDefeated']).delete()\n).run(conn)", 
        "description": "<p><strong>Example:</strong> Now that our heroes have defeated their villains, we can safely remove them from the villain table.</p>"
      }
    ], 
    "name": "for_each", 
    "io": [
      [
        "sequence", 
        "object"
      ]
    ], 
    "description": "\n\n\n\nLoop over a sequence, evaluating the given write query for each element.\n\n\n\n\n"
  }, 
  "/": {
    "examples": [
      {
        "code": "(r.expr(2) / 2).run(conn)", 
        "description": "<p><strong>Example:</strong> It's as easy as 2 / 2 = 1.</p>"
      }
    ], 
    "name": "/", 
    "io": [
      [
        "number", 
        "number"
      ]
    ], 
    "description": "\n\n\n\nDivide two numbers.\n\n"
  }, 
  "between": {
    "examples": [
      {
        "code": "r.table('marvel').between(10, 20).run(conn)", 
        "description": "<p><strong>Example:</strong> Find all users with primary key &gt;= 10 and &lt; 20 (a normal half-open interval).</p>"
      }, 
      {
        "code": "r.table('marvel').between(10, 20, right_bound='closed').run(conn)", 
        "description": "<p><strong>Example:</strong> Find all users with primary key &gt;= 10 and &lt;= 20 (an interval closed on\nboth sides).</p>"
      }, 
      {
        "code": "r.table('marvel').between(None, 20, right_bound='closed').run(conn)", 
        "description": "<p><strong>Example:</strong> Find all users with primary key &lt; 20. (You can use <code>NULL</code> to mean\n\"unbounded\" for either endpoint.)</p>"
      }, 
      {
        "code": "r.table('dc').between('dark_knight', 'man_of_steel', index='code_name').run(conn)", 
        "description": "<p><strong>Example:</strong> Between can be used on secondary indexes too. Just pass an optional index\nargument giving the secondary index to query.</p>"
      }
    ], 
    "name": "between", 
    "io": [
      [
        "table", 
        "selection"
      ]
    ], 
    "description": "\n\n\n\nGet all documents between two keys. Accepts three optional arguments: `index`,\n`left_bound`, and `right_bound`. If `index` is set to the name of a secondary index,\n`between` will return all documents where that index's value is in the specified range\n(it uses the primary key by default). `left_bound` or `right_bound` may be set to `open`\nor `closed` to indicate whether or not to include that endpoint of the range (by default,\n`left_bound` is closed and `right_bound` is open).\n\n\n\n\n\n\n\n"
  }, 
  "run": {
    "examples": [
      {
        "code": "for doc in r.table('marvel').run(conn):\n    print doc", 
        "description": "<p><strong>Example:</strong> Run a query on the connection <code>conn</code> and print out every\nrow in the result.</p>"
      }, 
      {
        "code": "r.table('marvel').run(conn, use_outdated=True)", 
        "description": "<p><strong>Example:</strong> If you are OK with potentially out of date data from all\nthe tables involved in this query and want potentially faster reads,\npass a flag allowing out of date data in an options object. Settings\nfor individual tables will supercede this global setting for all\ntables in the query.</p>"
      }, 
      {
        "code": "r.table('marvel').run(conn, noreply=True)", 
        "description": "<p><strong>Example:</strong> If you just want to send a write and forget about it, you\ncan set <code>noreply</code> to true in the options. In this case <code>run</code> will\nreturn immediately.</p>"
      }, 
      {
        "code": "r.table('marvel')\n    .insert({ 'superhero': 'Iron Man', 'superpower': 'Arc Reactor' })\n    .run(conn, noreply=True, durability='soft')", 
        "description": "<p><strong>Example:</strong> If you want to specify whether to wait for a write to be\nwritten to disk (overriding the table's default settings), you can set\n<code>durability</code> to <code>'hard'</code> or <code>'soft'</code> in the options.</p>"
      }, 
      {
        "code": "r.now().run(conn, time_format=\"raw\")", 
        "description": "<p><strong>Example:</strong> If you do not want a time object to be converted to a\nnative date object, you can pass a <code>time_format</code> flag to prevent it\n(valid flags are \"raw\" and \"native\"). This query returns an object\nwith two fields (<code>epoch_time</code> and <code>$reql_type$</code>) instead of a native date\nobject.</p>"
      }
    ], 
    "name": "run", 
    "io": [
      [
        "any", 
        null
      ]
    ], 
    "description": "\n\n\n\nRun a query on a connection, returning either a single JSON result or\na cursor, depending on the query.\n\n\n\n\n\n\n\n\n\n"
  }, 
  "index_wait": {
    "examples": [
      {
        "code": "r.table('test').index_wait().run(conn)", 
        "description": "<p><strong>Example:</strong> Wait for all indexes on the table <code>test</code> to be ready:</p>"
      }, 
      {
        "code": "r.table('test').index_wait('timestamp').run(conn)", 
        "description": "<p><strong>Example:</strong> Wait for the index <code>timestamp</code> to be ready:</p>"
      }
    ], 
    "name": "index_wait", 
    "io": [
      [
        "table", 
        "array"
      ]
    ], 
    "description": "\n\n\n\nWait for the specified indexes on this table to be ready, or for all\nindexes on this table to be ready if no indexes are specified.\n\n\n"
  }, 
  "seconds": {
    "examples": [
      {
        "code": "r.table(\"posts\").filter(lambda post:\n    post[\"date\"].seconds() < 30\n).run(conn)", 
        "description": "<p><strong>Example:</strong> Return the post submitted during the first 30 seconds of every minute.</p>"
      }
    ], 
    "name": "seconds", 
    "io": [
      [
        "time", 
        "number"
      ]
    ], 
    "description": "\n\n\n\nReturn the seconds in a time object as a number between 0 and 59.999 (double precision).\n\n\n\n"
  }, 
  "pluck": {
    "examples": [
      {
        "code": "r.table('marvel').get('IronMan').pluck('reactorState', 'reactorPower').run(conn)", 
        "description": "<p><strong>Example:</strong> We just need information about IronMan's reactor and not the rest of the\ndocument.</p>"
      }, 
      {
        "code": "r.table('marvel').pluck('beauty', 'muscleTone', 'charm').run(conn)", 
        "description": "<p><strong>Example:</strong> For the hero beauty contest we only care about certain qualities.</p>"
      }, 
      {
        "code": "r.table('marvel').pluck({'abilities' : {'damage' : True, 'mana_cost' : True}, 'weapons' : True}).run(conn)", 
        "description": "<p><strong>Example:</strong> Pluck can also be used on nested objects.</p>"
      }, 
      {
        "code": "r.table('marvel').pluck({'abilities' : ['damage', 'mana_cost']}, 'weapons').run(conn)", 
        "description": "<p><strong>Example:</strong> The nested syntax can quickly become overly verbose so there's a shorthand\nfor it.</p>"
      }
    ], 
    "name": "pluck", 
    "io": [
      [
        "sequence", 
        "stream"
      ], 
      [
        "array", 
        "array"
      ], 
      [
        "object", 
        "object"
      ], 
      [
        "singleSelection", 
        "object"
      ]
    ], 
    "description": "\n\n\n\nPlucks out one or more attributes from either an object or a sequence of objects\n(projection).\n\n\n\n\n\n\n\n\n"
  }, 
  "js": {
    "examples": [
      {
        "code": "r.js(\"'str1' + 'str2'\").run(conn)", 
        "description": "<p><strong>Example:</strong> Concatenate two strings using Javascript'</p>"
      }, 
      {
        "code": "r.table('marvel').filter(\n    r.js('(function (row) { return row.magazines > 5; })')\n).run(conn)", 
        "description": "<p><strong>Example:</strong> Select all documents where the 'magazines' field is greater than 5 by running Javascript on the server.</p>"
      }, 
      {
        "code": "r.js('while(true) {}', timeout=1.3).run(conn)", 
        "description": "<p><strong>Example:</strong> You may also specify a timeout in seconds (defaults to 5).</p>"
      }
    ], 
    "name": "js", 
    "io": [
      [
        "r", 
        "value"
      ]
    ], 
    "description": "\n\n\n\nCreate a javascript expression.\n\n\n\n\n\n"
  }, 
  "hours": {
    "examples": [
      {
        "code": "r.table(\"posts\").filter(lambda post:\n    post[\"date\"].hours() < 4\n).run(conn)", 
        "description": "<p><strong>Example:</strong> Return all the posts submitted after midnight and before 4am.</p>"
      }
    ], 
    "name": "hours", 
    "io": [
      [
        "time", 
        "number"
      ]
    ], 
    "description": "\n\n\n\nReturn the hour in a time object as a number between 0 and 23.\n\n\n"
  }, 
  "to_epoch_time": {
    "examples": [
      {
        "code": "r.now().to_epoch_time()", 
        "description": "<p><strong>Example:</strong> Return the current time in an ISO8601 format.</p>"
      }
    ], 
    "name": "to_epoch_time", 
    "io": [
      [
        "time", 
        "number"
      ]
    ], 
    "description": "\n\n\n\nConvert a time object to its epoch time.\n\n\n\n"
  }, 
  "count": {
    "examples": [
      {
        "code": "r.table('marvel').group_by('strength', r.count).run(conn)", 
        "description": "<p><strong>Example:</strong> Just how many heroes do we have at each strength level?</p>"
      }
    ], 
    "name": "count", 
    "io": [
      [
        "r", 
        null
      ]
    ], 
    "description": "\n\n\n\nCount the total size of the group.\n\n"
  }, 
  "filter": {
    "examples": [
      {
        "code": "r.table('users').filter({\"age\": 30}).run(conn)", 
        "description": "<p><strong>Example:</strong> Get all the users that are 30 years old.</p>"
      }, 
      {
        "code": "r.table(\"users\").filter( r.row[\"age\"] > 18 ).run(conn)", 
        "description": "<p><strong>Example:</strong> Get all the users that are more than 18 years old.</p>"
      }, 
      {
        "code": "r.table(\"users\").filter( r.row[\"age\"] < 18, default=True).run(conn)", 
        "description": "<p><strong>Example:</strong> Get all the users that are less than 18 years old or whose age is unknown\n(field <code>age</code> missing).</p>"
      }, 
      {
        "code": "r.table(\"users\").filter( r.row[\"age\"] > 18, default=r.error()).run(conn)", 
        "description": "<p><strong>Example:</strong> Get all the users that are more than 18 years old. Throw an error if a\ndocument is missing the field <code>age</code>.</p>"
      }, 
      {
        "code": "r.table('users').filter( lambda user:\n    user.has_fields('phone_number')\n).run(conn)", 
        "description": "<p><strong>Example:</strong> Select all users who have given their phone number (all the documents\nwhose field <code>phone_number</code> is defined and not <code>None</code>).</p>"
      }, 
      {
        "code": "r.table(\"users\").filter( lambda user:\n    user[\"subscription_date\"].during( r.time(2012, 1, 1, 'Z'), r.time(2013, 1, 1, 'Z') )\n).run(conn)", 
        "description": "<p><strong>Example:</strong> Retrieve all the users who subscribed between January 1st, 2012\n(included) and January 1st, 2013 (excluded).</p>"
      }, 
      {
        "code": "r.table(\"users\").filter( lambda user:\n    user[\"email\"].match(\"@gmail.com$\")\n).run(conn)", 
        "description": "<p><strong>Example:</strong> Retrieve all the users who have a gmail account (whose field <code>email</code> ends\nwith <code>@gmail.com</code>).</p>"
      }, 
      {
        "code": "{\n    \"name\": <type 'str'>\n    \"places_visited\": [<type 'str'>]\n}", 
        "description": "<p><strong>Example:</strong> Filter based on the presence of a value in an array.</p>\n<p>Suppose the table <code>users</code> has the following schema</p>"
      }, 
      {
        "code": "{\n    \"id\": <type 'str'>\n    \"name\": {\n        \"first\": <type 'str'>,\n        \"middle\": <type 'str'>,\n        \"last\": <type 'str'>\n    }\n}", 
        "description": "<p><strong>Example:</strong> Filter based on nested fields.</p>\n<p>Suppose we have a table <code>users</code> containing documents with the following schema.</p>"
      }
    ], 
    "name": "filter", 
    "io": [
      [
        "sequence", 
        "selection"
      ], 
      [
        "stream", 
        "stream"
      ], 
      [
        "array", 
        "array"
      ]
    ], 
    "description": "\n\n\n\nGet all the documents for which the given predicate is true.\n\n`filter` can be called on a sequence, selection, or a field containing an array of\nelements. The return type is the same as the type on which the function was called on.\n\nThe body of every filter is wrapped in an implicit `.default(False)`, which means that\nif a non-existence errors is thrown (when you try to access a field that does not exist\nin a document), RethinkDB will just ignore the document.\nThe `default` value can be changed by passing the named argument `default`.\nSetting this optional argument to `r.error()` will cause any non-existence errors to\nreturn a `RqlRuntimeError`.\n\n\n\nA more general way to write the previous query is to use `r.row`.\n\n```py\nr.table('users').filter( r.row[\"age\"] == 30 ).run(conn)\n```\n\nHere the predicate is `r.row[\"age\"] == 30`.\n\n- `r.row` refers to the current document\n- `r.row[\"age\"]` refers to the field `age` of the current document\n- `r.row[\"age\"] == 30` returns `True` if the field `age` is 30\n\n\nAn even more general way to write the same query is to use a lambda function.\nRead the documentation about [r.row](../row/) to know more about the differences\nbetween `r.row` and lambda functions in ReQL.\n\n```py\nr.table('users').filter( lambda user:\n    user[\"age\"] == 30\n).run(conn)\n```\n\n\n\n\n\n\n\n\n\n\n\n\nRetrieve all the users whose field `places_visited` contains `France`.\n\n```py\nr.table(\"users\").filter( lambda user:\n    user[\"places_visited\"].contains(\"France\")\n).run(conn)\n```\n\n\nRetrieve all users named \"William Adama\" (first name \"William\", last name\n\"Adama\"), with any middle name.\n\n\n```py\nr.table(\"users\").filter({\n    \"name\":{\n        \"first\": \"William\",\n        \"last\": \"Adama\"\n    }\n}).run(conn)\n```\n\nIf you want an exact match for a field that is an object, you will have to use `r.literal`.\n\nRetrieve all users named \"William Adama\" (first name \"William\", last name\n\"Adama\"), and who do not have a middle name.\n\n```py\nr.table(\"users\").filter(r.literal({\n    \"name\":{\n        \"first\": \"William\",\n        \"last\": \"Adama\"\n    }\n})).run(conn)\n```\n\n\nThe equivalent queries with a lambda function.\n\n```py\nr.table(\"users\").filter( lambda user:\n    (user[\"name\"][\"first\"] == \"William\")\n        & (user[\"name\"][\"last\"] == \"Adama\")\n).run(conn)\n```\n\n```py\nr.table(\"users\").filter( lambda user:\n    user[\"name\"] == {\n        \"first\": \"William\",\n        \"last\": \"Adama\"\n    }\n).run(conn)\n```\n"
  }, 
  "union": {
    "examples": [
      {
        "code": "r.table('marvel').union(r.table('dc')).run(conn)", 
        "description": "<p><strong>Example:</strong> Construct a stream of all heroes.</p>"
      }
    ], 
    "name": "union", 
    "io": [
      [
        "sequence", 
        "array"
      ]
    ], 
    "description": "\n\n\n\nConcatenate two sequences.\n\n\n"
  }, 
  "delete": {
    "examples": [
      {
        "code": "r.table('marvel').get('superman').delete().run(conn)", 
        "description": "<p><strong>Example:</strong> Delete superman from the database.</p>"
      }, 
      {
        "code": "r.table('marvel').delete(durability='soft').run(conn)", 
        "description": "<p><strong>Example:</strong> Delete every document from the table 'marvel'. Also, don't wait for the\noperation to be flushed to disk.</p>"
      }, 
      {
        "code": "r.table('marvel').delete(return_vals=True).run(conn)", 
        "description": "<p><strong>Example:</strong> You can get back a copy of the row you delete from the database as well.</p>"
      }
    ], 
    "name": "delete", 
    "io": [
      [
        "table", 
        "object"
      ], 
      [
        "selection", 
        "object"
      ], 
      [
        "singleSelection", 
        "object"
      ]
    ], 
    "description": "\n\n\n\nDelete one or more documents from a table. The optional argument return_vals will return\nthe old value of the row you're deleting when set to true (only valid for single-row\ndeletes). The optional argument durability with value 'hard' or 'soft' will override the\ntable or query's default durability setting.\n\nDelete returns an object that contains the following attributes:\n\n- `deleted`: the number of documents that were deleted\n- `skipped`: the number of documents from the selection that were left unmodified because\nthere was nothing to do. For example, if you delete a row that has already been deleted,\nthat row will be skipped\n- `errors`L the number of errors encountered while deleting\nif errors occured, first_error contains the text of the first error\n- `inserted`, `replaced`, and `unchanged`: all 0 for a delete operation.\n\n\n\n\n\n\n\n"
  }, 
  "table_list": {
    "examples": [
      {
        "code": "r.db('test').table_list().run(conn)", 
        "description": "<p><strong>Example:</strong> List all tables of the 'test' database.</p>"
      }
    ], 
    "name": "table_list", 
    "io": [
      [
        "db", 
        "array"
      ]
    ], 
    "description": "\n\n\n\nList all table names in a database. The result is a list of strings.\n\n"
  }, 
  "with_fields": {
    "examples": [
      {
        "code": "r.table('marvel').with_fields('id', 'nemesis')", 
        "description": "<p><strong>Example:</strong> Get a list of heroes and their nemeses, excluding any heroes that lack one.</p>"
      }, 
      {
        "code": "r.table('marvel').with_fields('id', {'nemesis' : {'evil_organization' : True}})", 
        "description": "<p><strong>Example:</strong> Get a list of heroes and their nemeses, excluding any heroes whose nemesis isn't in an evil organization.</p>"
      }, 
      {
        "code": "r.table('marvel').with_fields('id', {'nemesis' : 'evil_organization'})", 
        "description": "<p><strong>Example:</strong> The nested syntax can quickly become overly verbose so there's a shorthand.</p>"
      }
    ], 
    "name": "with_fields", 
    "io": [
      [
        "sequence", 
        "stream"
      ], 
      [
        "array", 
        "array"
      ]
    ], 
    "description": "\n\n\n\nTakes a sequence of objects and a list of fields. If any objects in the sequence don't\nhave all of the specified fields, they're dropped from the sequence. The remaining\nobjects have the specified fields plucked out. (This is identical to `has_fields`\nfollowed by `pluck` on a sequence.)\n\n\n\n\n\n"
  }, 
  "[] (get_field)": {
    "examples": [
      {
        "code": "r.table('marvel').get('IronMan')['firstAppearance'].run(conn)", 
        "description": "<p><strong>Example:</strong> What was Iron Man's first appearance in a comic?</p>"
      }
    ], 
    "name": "[] (get_field)", 
    "io": [
      [
        "sequence", 
        "sequence"
      ], 
      [
        "singleSelection", 
        "value"
      ], 
      [
        "object", 
        "value"
      ]
    ], 
    "description": "\n\n\n\nGet a single field from an object. If called on a sequence, gets that field from every\nobject in the sequence, skipping objects that lack it.\n\n"
  }, 
  "*": {
    "examples": [
      {
        "code": "(r.expr(2) * 2).run(conn)", 
        "description": "<p><strong>Example:</strong> It's as easy as 2 * 2 = 4.</p>"
      }, 
      {
        "code": "(r.expr([\"This\", \"is\", \"the\", \"song\", \"that\", \"never\", \"ends.\"]) * 100).run(conn)", 
        "description": "<p><strong>Example:</strong> Arrays can be multiplied by numbers as well.</p>"
      }
    ], 
    "name": "*", 
    "io": [
      [
        "number", 
        "number"
      ], 
      [
        "array", 
        "array"
      ]
    ], 
    "description": "\n\n\n\nMultiply two numbers, or make a periodic array.\n\n\n\n\n"
  }, 
  ">=": {
    "examples": [
      {
        "code": "(r.expr(2) >= 2).run(conn)", 
        "description": "<p><strong>Example:</strong> Is 2 greater than or equal to 2?</p>"
      }
    ], 
    "name": ">=", 
    "io": [
      [
        "value", 
        "bool"
      ]
    ], 
    "description": "\n\n\n\nTest if the first value is greater than or equal to other.\n\n\n"
  }, 
  "index_create": {
    "examples": [
      {
        "code": "r.table('dc').index_create('code_name').run(conn)", 
        "description": "<p><strong>Example:</strong> To efficiently query our heros by code name we have to create a secondary\nindex.</p>"
      }, 
      {
        "code": "r.table('dc').index_create('power_rating',\nlambda hero: hero['combat_power'] + (2 * hero['compassion_power'])\n).run(conn)", 
        "description": "<p><strong>Example:</strong> You can also create a secondary index based on an arbitrary function on the document.</p>"
      }, 
      {
        "code": "r.table('dc').index_create('parental_planets',\nlambda hero: [hero['mothers_home_planet'], hero['fathers_home_planet']]\n).run(conn)", 
        "description": "<p><strong>Example:</strong> A compound index can be created by returning an array of values to use as\nthe secondary index key.</p>"
      }, 
      {
        "code": "r.table('dc').index_create('abilities', multi=True).run(conn)", 
        "description": "<p><strong>Example:</strong> A multi index can be created by passing an optional multi argument. Multi\nindexes functions should return arrays and allow you to query based on whether a value\nis present in the returned array. The example would allow us to get heroes who possess a\nspecific ability (the field 'abilities' is an array).</p>"
      }
    ], 
    "name": "index_create", 
    "io": [
      [
        "table", 
        "object"
      ]
    ], 
    "description": "\n\n\n\nCreate a new secondary index on this table.\n\n\n\n\n\n\n\n\n"
  }, 
  "change_at": {
    "examples": [
      {
        "code": "r.expr([\"Iron Man\", \"Bruce\", \"Spider-Man\"]).change_at(1, \"Hulk\").run(conn)", 
        "description": "<p><strong>Example:</strong> Bruce Banner hulks out.</p>"
      }
    ], 
    "name": "change_at", 
    "io": [
      [
        "array", 
        "array"
      ]
    ], 
    "description": "\n\n\n\nChange a value in an array at a given index. Returns the modified array.\n\n"
  }, 
  "table": {
    "examples": [
      {
        "code": "r.table('marvel').run(conn)", 
        "description": "<p><strong>Example:</strong> Return all documents in the table 'marvel' of the default database.</p>"
      }, 
      {
        "code": "r.db('heroes').table('marvel').run(conn)", 
        "description": "<p><strong>Example:</strong> Return all documents in the table 'marvel' of the database 'heroes'.</p>"
      }, 
      {
        "code": "r.db('heroes').table('marvel', True).run(conn)", 
        "description": "<p><strong>Example:</strong> If you are OK with potentially out of date data from this table and want\npotentially faster reads, pass a flag allowing out of date data.</p>"
      }
    ], 
    "name": "table", 
    "io": [
      [
        "db", 
        "table"
      ]
    ], 
    "description": "\n\n\n\nSelect all documents in a table. This command can be chained with other commands to do\nfurther processing on the data.\n\n\n\n\n\n\n"
  }, 
  "[] (nth)": {
    "examples": [
      {
        "code": "r.expr([1,2,3])[1].run(conn)", 
        "description": "<p><strong>Example:</strong> Select the second element in the array.</p>"
      }
    ], 
    "name": "[] (nth)", 
    "io": [
      [
        "sequence", 
        "object"
      ]
    ], 
    "description": "\n\n\n\nGet the nth element of a sequence.\n\n\n\n"
  }, 
  "!=": {
    "examples": [
      {
        "code": "(r.expr(2) != 2).run(conn)", 
        "description": "<p><strong>Example:</strong> Does 2 not equal 2?</p>"
      }
    ], 
    "name": "!=", 
    "io": [
      [
        "value", 
        "bool"
      ]
    ], 
    "description": "\n\n\n\nTest if two values are not equal.\n\n\n\n"
  }, 
  "use": {
    "examples": [
      {
        "code": "conn.use('marvel')\nr.table('heroes').run(conn) # refers to r.db('marvel').table('heroes')", 
        "description": "<p><strong>Example:</strong> Change the default database so that we don't need to\nspecify the database when referencing a table.</p>"
      }
    ], 
    "name": "use", 
    "io": [
      [
        "connection", 
        "undefined"
      ]
    ], 
    "description": "\n\n\n\nChange the default database on this connection.\n\n"
  }, 
  "order_by": {
    "examples": [
      {
        "code": "r.table('marvel').order_by('enemies_vanquished', 'damsels_saved').run(conn)", 
        "description": "<p><strong>Example:</strong> Order our heroes by a series of performance metrics.</p>"
      }, 
      {
        "code": "r.table('marvel').order_by('damsels_saved', index='enemies_vanquished').run(conn)", 
        "description": "<p><strong>Example:</strong> Indexes can be used to perform more efficient orderings. Notice that the\nindex ordering always has highes precedence. Thus the following example is equivalent to\nthe one above.</p>"
      }, 
      {
        "code": "r.table('marvel').order_by(index=r.desc('enemies_vanquished')).run(conn)", 
        "description": "<p><strong>Example:</strong> You can also specify a descending order when using an index.</p>"
      }, 
      {
        "code": "r.table('marvel').order_by(\n    r.desc('enemies_vanquished'),\n    r.asc('damsels_saved')\n).run(conn)", 
        "description": "<p><strong>Example:</strong> Let's lead with our best vanquishers by specify descending ordering.</p>"
      }, 
      {
        "code": "r.table('marvel').order_by(lambda doc: doc['enemiesVanquished'] + doc['damselsSaved']).run(conn)", 
        "description": "<p><strong>Example:</strong> You can use a function for ordering instead of just selecting an attribute.</p>"
      }, 
      {
        "code": "r.table('marvel').order_by(r.desc(lambda doc: doc['enemiesVanquished'] + doc['damselsSaved'])).run(conn)", 
        "description": "<p><strong>Example:</strong> Functions can also be used descendingly.</p>"
      }
    ], 
    "name": "order_by", 
    "io": [
      [
        "sequence", 
        "stream"
      ], 
      [
        "array", 
        "array"
      ]
    ], 
    "description": "\n\n\n\nSort the sequence by document values of the given key(s). `orderBy` defaults to ascending\nordering. To explicitly specify the ordering, wrap the attribute with either `r.asc` or\n`r.desc`.\n\n\n\n\n\n\n\n\n\n"
  }, 
  "zip": {
    "examples": [
      {
        "code": "r.table('marvel').eq_join('main_dc_collaborator', r.table('dc')).zip().run(conn)", 
        "description": "<p><strong>Example:</strong> 'zips up' the sequence by merging the left and right fields produced by a join.</p>"
      }
    ], 
    "name": "zip", 
    "io": [
      [
        "stream", 
        "stream"
      ], 
      [
        "array", 
        "array"
      ]
    ], 
    "description": "\n\n\n\nUsed to 'zip' up the result of a join by merging the 'right' fields into 'left' fields of each member of the sequence.\n\n"
  }, 
  "&": {
    "examples": [
      {
        "code": "(r.expr(True) & False).run(conn)", 
        "description": "<p><strong>Example:</strong> True and false anded is false?</p>"
      }
    ], 
    "name": "&", 
    "io": [
      [
        "bool", 
        "bool"
      ]
    ], 
    "description": "\n\n\n\nCompute the logical and of two values.\n\n"
  }, 
  "distinct": {
    "examples": [
      {
        "code": "r.table('marvel').concat_map(lambda hero: hero['villainList']).distinct().run(conn)", 
        "description": "<p><strong>Example:</strong> Which unique villains have been vanquished by marvel heroes?</p>"
      }
    ], 
    "name": "distinct", 
    "io": [
      [
        "sequence", 
        "value"
      ]
    ], 
    "description": "\n\n\n\nRemove duplicate elements from the sequence.\n\n"
  }, 
  "contains": {
    "examples": [
      {
        "code": "r.table('marvel').get('ironman')['opponents'].contains('superman').run(conn)", 
        "description": "<p><strong>Example:</strong> Has Iron Man ever fought Superman?</p>"
      }, 
      {
        "code": "r.table('marvel').get('ironman')['battles'].contains(lambda battle:\n    (battle['winner'] == 'ironman') & (battle['loser'] == 'superman')\n).run(conn)", 
        "description": "<p><strong>Example:</strong> Has Iron Man ever defeated Superman in battle?</p>"
      }
    ], 
    "name": "contains", 
    "io": [
      [
        "sequence", 
        "value"
      ]
    ], 
    "description": "\n\n\n\nReturns whether or not a sequence contains all the specified values, or if functions are\nprovided instead, returns whether or not a sequence contains values matching all the\nspecified functions.\n\n\n\n"
  }, 
  "table_drop": {
    "examples": [
      {
        "code": "r.db('test').table_drop('dc_universe').run(conn)", 
        "description": "<p><strong>Example:</strong> Drop a table named 'dc_universe'.</p>"
      }
    ], 
    "name": "table_drop", 
    "io": [
      [
        "db", 
        "object"
      ]
    ], 
    "description": "\n\n\n\nDrop a table. The table and all its data will be deleted.\n\nIf succesful, the operation returns an object: {\"dropped\": 1}. If the specified table\ndoesn't exist a `RqlRuntimeError` is thrown.\n\n\n\n"
  }, 
  "set_difference": {
    "examples": [
      {
        "code": "r.table('marvel').get('IronMan')['equipment'].set_difference(['newBoots', 'arc_reactor']).run(conn)", 
        "description": "<p><strong>Example:</strong> Check which pieces of equipment Iron Man has, excluding a fixed list.</p>"
      }
    ], 
    "name": "set_difference", 
    "io": [
      [
        "array", 
        "array"
      ]
    ], 
    "description": "\n\n\n\nRemove the elements of one array from another and return them as a set (an array with\ndistinct values).\n\n"
  }, 
  "json": {
    "examples": [
      {
        "code": "r.json(\"[1,2,3]\").run(conn)", 
        "description": "<p><strong>Example:</strong> Send an array to the server'</p>"
      }
    ], 
    "name": "json", 
    "io": [
      [
        "r", 
        "value"
      ]
    ], 
    "description": "\n\n\n\nParse a JSON string on the server.\n\n\n\n"
  }, 
  "in_timezone": {
    "examples": [
      {
        "code": "r.now().in_timezone('-08:00').hours().run(conn)", 
        "description": "<p><strong>Example:</strong> Hour of the day in San Francisco (UTC/GMT -8, without daylight saving time).</p>"
      }
    ], 
    "name": "in_timezone", 
    "io": [
      [
        "time", 
        "time"
      ]
    ], 
    "description": "\n\n\n\nReturn a new time object with a different timezone. While the time stays the same, the results returned by methods such as hours() will change since they take the timezone into account. The timezone argument has to be of the ISO 8601 format.\n\n"
  }, 
  ">": {
    "examples": [
      {
        "code": "(r.expr(2) != 2).run(conn)", 
        "description": "<p><strong>Example:</strong> Does 2 not equal 2?</p>"
      }
    ], 
    "name": ">", 
    "io": [
      [
        "value", 
        "bool"
      ]
    ], 
    "description": "\n\n\n\nTest if two values are not equal.\n\n\n"
  }, 
  "grouped_map_reduce": {
    "examples": [
      {
        "code": "r.table('marvel').grouped_map_reduce(\n    lambda hero: hero['weightClass'],  # grouping\n    lambda hero: hero.pluck('name', 'strength'),  # mapping\n    lambda acc, hero: r.branch(acc['strength'] < hero['strength'], hero, acc),\n    {'name':'none', 'strength':0}  # base\n).run(conn)", 
        "description": "<p><strong>Example:</strong> It's only fair that heroes be compared against their weight class.</p>"
      }
    ], 
    "name": "grouped_map_reduce", 
    "io": [
      [
        "sequence", 
        "value"
      ]
    ], 
    "description": "\n\n\n\nPartition the sequence into groups based on the `grouping` function. The elements of each\ngroup are then mapped using the `mapping` function and reduced using the `reduction`\nfunction.\n\n`grouped_map_reduce` is a generalized form of group by.\n\n\n\n"
  }, 
  "iso8601": {
    "examples": [
      {
        "code": "r.table(\"user\").get(\"John\").update({\"birth\": r.iso8601('1986-11-03T08:30:00-07:00')}).run(conn)", 
        "description": "<p><strong>Example:</strong> Update the time of John's birth.</p>"
      }
    ], 
    "name": "iso8601", 
    "io": [
      [
        "r", 
        "time"
      ]
    ], 
    "description": "\n\n\n\nCreate a time object based on an iso8601 date-time string (e.g.\n'2013-01-01T01:01:01+00:00'). We support all valid ISO 8601 formats except for week\ndates. If you pass an ISO 8601 date-time without a time zone, you must specify the time\nzone with the optarg `default_timezone`. Read more about the ISO 8601 format on the\nWikipedia page.\n\n\n"
  }, 
  "info": {
    "examples": [
      {
        "code": "r.table('marvel').info().run(conn)", 
        "description": "<p><strong>Example:</strong> Get information about a table such as primary key, or cache size.</p>"
      }
    ], 
    "name": "info", 
    "io": [
      [
        "any", 
        "object"
      ]
    ], 
    "description": "\n\n\n\nGet information about a ReQL value.\n\n\n\n"
  }, 
  "default": {
    "examples": [
      {
        "code": "r.table(\"users\").filter(lambda user:\n    (user[\"age\"] < 18).default(True)\n).run(conn)", 
        "description": "<p><strong>Example:</strong> The <code>default</code> command can be useful to filter documents too. Suppose\nwe want to retrieve all our users who are not grown-ups or whose age is unknown\n(i.e the field <code>age</code> is missing or equals <code>None</code>). We can do it with this query:</p>"
      }
    ], 
    "name": "default", 
    "io": [
      [
        "value", 
        "any"
      ], 
      [
        "sequence", 
        "any"
      ]
    ], 
    "description": "\n\n\n\nHandle non-existence errors. Tries to evaluate and return its first argument. If an\nerror related to the absence of a value is thrown in the process, or if its first\nargument returns `None`, returns its second argument. (Alternatively, the second argument\nmay be a function which will be called with either the text of the non-existence error\nor `None`.)\n\n\n__Exmple:__ Suppose we want to retrieve the titles and authors of the table `posts`.\nIn the case where the author field is missing or `None`, we want to retrieve the string\n`Anonymous`.\n\n```py\nr.table(\"posts\").map(lambda post:\n    {\n        \"title\": post[\"title\"],\n        \"author\": post[\"author\"].default(\"Anonymous\")\n    }\n).run(conn)\n```\n\nWe can rewrite the previous query with `r.branch` too.\n\n```py\nr.table(\"posts\").map(lambda post:\n    r.branch(\n        post.has_fields(\"author\"),\n        {\n            \"title\": post[\"title\"],\n            \"author\": post[\"author\"]\n        },\n        {\n            \"title\": post[\"title\"],\n            \"author\": \"Anonymous\" \n        }\n    )\n).run(conn)\n```\n\n\n\nOne more way to write the previous query is to set the age to be `-1` when the\nfield is missing.\n\n```py\nr.table(\"users\").filter(lambda user:\n    user[\"age\"].default(-1) < 18\n).run(conn)\n```\n\nOne last way to do the same query is to use `has_fields`.\n\n```py\nr.table(\"users\").filter(lambda user:\n    user.has_fields(\"age\").not_() | (user[\"age\"] < 18)\n).run(conn)\n```\n\nThe body of every `filter` is wrapped in an implicit `.default(False)`. You can overwrite\nthe value `False` by passing an option in filter, so the previous query can also be\nwritten like this.\n\n```py\nr.table(\"users\").filter(\n    lambda user: (user[\"age\"] < 18).default(True),\n    default=True\n).run(conn)\n```\n\n"
  }, 
  "expr": {
    "examples": [
      {
        "code": "r.expr({'a':'b'}).merge({'b':[1,2,3]}).run(conn)", 
        "description": "<p><strong>Example:</strong> Objects wrapped with expr can then be manipulated by ReQL API functions.</p>"
      }
    ], 
    "name": "expr", 
    "io": [
      [
        "r", 
        "value"
      ]
    ], 
    "description": "\n\n\n\nConstruct a ReQL JSON object from a native object.\n\n\n\n"
  }, 
  "day_of_week": {
    "examples": [
      {
        "code": "r.now().day_of_week().run(conn)", 
        "description": "<p><strong>Example:</strong> Return today's day of week.</p>"
      }, 
      {
        "code": "r.table(\"users\").filter{ |user|\n    user[\"birthdate\"].day_of_week().eq(r.tuesday)\n}", 
        "description": "<p><strong>Example:</strong> Retrieve all the users who were born on a Tuesday.</p>"
      }
    ], 
    "name": "day_of_week", 
    "io": [
      [
        "time", 
        "number"
      ]
    ], 
    "description": "\n\n\n\n\nReturn the day of week of a time object as a number between 1 and 7 (following ISO 8601 standard). For your convenience, the terms r.monday, r.tuesday etc. are defined and map to the appropriate integer.\n\n\n\n"
  }, 
  "r": {
    "examples": [
      {
        "code": "import rethinkdb as r", 
        "description": "<p><strong>Example:</strong> Setup your top-level namespace.</p>"
      }
    ], 
    "name": "r", 
    "io": [
      [
        null, 
        "r"
      ]
    ], 
    "description": "\n\n\n\nThe top-level ReQL namespace.\n\n\n"
  }, 
  "limit": {
    "examples": [
      {
        "code": "r.table('marvel').order_by('belovedness').limit(10).run(conn)", 
        "description": "<p><strong>Example:</strong> Only so many can fit in our Pantheon of heroes.</p>"
      }
    ], 
    "name": "limit", 
    "io": [
      [
        "sequence", 
        "stream"
      ], 
      [
        "array", 
        "array"
      ]
    ], 
    "description": "\n\n\n\n\nEnd the sequence after the given number of elements.\n\n"
  }, 
  "error": {
    "examples": [
      {
        "code": "r.table('marvel').get('IronMan').do(\n    lambda ironman: r.branch(ironman['victories'] < ironman['battles'],\n                             r.error('impossible code path'),\n                             ironman)\n).run(conn)", 
        "description": "<p><strong>Example:</strong> Iron Man can't possibly have lost a battle:</p>"
      }
    ], 
    "name": "error", 
    "io": [
      [
        "r", 
        "error"
      ]
    ], 
    "description": "\n\n\n\nThrow a runtime error. If called with no arguments inside the second argument to `default`, re-throw the current error.\n\n\n\n"
  }, 
  "set_insert": {
    "examples": [
      {
        "code": "r.table('marvel').get('IronMan')['equipment'].set_insert('newBoots').run(conn)", 
        "description": "<p><strong>Example:</strong> Retrieve Iron Man's equipment list with the addition of some new boots.</p>"
      }
    ], 
    "name": "set_insert", 
    "io": [
      [
        "array", 
        "array"
      ]
    ], 
    "description": "\n\n\n\nAdd a value to an array and return it as a set (an array with distinct values).\n\n\n\n"
  }, 
  "minutes": {
    "examples": [
      {
        "code": "r.table(\"posts\").filter(lambda post:\n    post[\"date\"].minutes() < 10\n).run(conn)", 
        "description": "<p><strong>Example:</strong> Return all the posts submitted during the first 10 minutes of every hour.</p>"
      }
    ], 
    "name": "minutes", 
    "io": [
      [
        "time", 
        "number"
      ]
    ], 
    "description": "\n\n\nReturn the minute in a time object as a number between 0 and 59.\n\n"
  }, 
  "~": {
    "examples": [
      {
        "code": "(~r.expr(True)).run(conn)", 
        "description": "<p><strong>Example:</strong> Not true is false.</p>"
      }, 
      {
        "code": "r.expr(True).not_().run(conn)", 
        "description": "<p><strong>Example:</strong> The previous query can be rewritten with <code>not_</code></p>"
      }
    ], 
    "name": "~", 
    "io": [
      [
        "bool", 
        "bool"
      ]
    ], 
    "description": "\n\n\nCompute the logical inverse (not).\n\n\nNote the parentheses around the query. If you execute\n\n```py\n~r.expr(True).run(conn)\n```\n\nYou will get back `-2` because the query executed is `r.expr(True)` which returns `True`,\nand because `~True` evaluates to `-2` in Python.\n\n"
  }, 
  "<=": {
    "examples": [
      {
        "code": "(r.expr(2) <= 2).run(conn)", 
        "description": "<p><strong>Example:</strong> Is 2 less than or equal to 2?</p>"
      }
    ], 
    "name": "<=", 
    "io": [
      [
        "value", 
        "bool"
      ]
    ], 
    "description": "\n\n\n\nTest if the first value is less than or equal to other.\n\n\n\n"
  }, 
  "sample": {
    "examples": [
      {
        "code": "r.table('marvel').sample(3).run(conn)", 
        "description": "<p><strong>Example:</strong> Select 3 random heroes.</p>"
      }
    ], 
    "name": "sample", 
    "io": [
      [
        "sequence", 
        "selection"
      ], 
      [
        "stream", 
        "array"
      ], 
      [
        "array", 
        "array"
      ]
    ], 
    "description": "\n\n\n\nSelect a given number of elements from a sequence with uniform random distribution. Selection is done without replacement.\n\n"
  }, 
  "timezone": {
    "examples": [
      {
        "code": "r.table(\"users\").filter(lambda user:\n    user[\"subscriptionDate\"].timezone() == \"-07:00\"\n)", 
        "description": "<p><strong>Example:</strong> Return all the users in the \"-07:00\" timezone.</p>"
      }
    ], 
    "name": "timezone", 
    "io": [
      [
        "time", 
        "time"
      ]
    ], 
    "description": "\n\n\n\nReturn the timezone of the time object.\n\n\n\n"
  }, 
  "avg": {
    "examples": [
      {
        "code": "r.table('marvel').group_by('strength', r.avg('agility')).run(conn)", 
        "description": "<p><strong>Example:</strong> What's the average agility of heroes at each strength level?</p>"
      }
    ], 
    "name": "avg", 
    "io": [
      [
        "r", 
        null
      ]
    ], 
    "description": "\n\n\n\nCompute the average value of the given attribute for the group.\n\n"
  }, 
  "has_fields": {
    "examples": [
      {
        "code": "r.table('marvel').has_fields('spouse').run(conn)", 
        "description": "<p><strong>Example:</strong> Which heroes are married?</p>"
      }, 
      {
        "code": "r.table('marvel').get(\"IronMan\").has_fields('spouse').run(conn)", 
        "description": "<p><strong>Example:</strong> Test if a single object has a field.</p>"
      }, 
      {
        "code": "r.table('marvel').has_fields({'spouse' : {'powers' : True}}).run(conn)", 
        "description": "<p><strong>Example:</strong> You can also test if nested fields exist to get only spouses with powers of their own.</p>"
      }, 
      {
        "code": "r.table('marvel').has_fields({'spouse' : 'powers'}).run(conn)", 
        "description": "<p><strong>Example:</strong> The nested syntax can quickly get verbose so there's a shorthand.</p>"
      }
    ], 
    "name": "has_fields", 
    "io": [
      [
        "sequence", 
        "stream"
      ], 
      [
        "array", 
        "array"
      ], 
      [
        "singleSelection", 
        "boolean"
      ], 
      [
        "object", 
        "boolean"
      ]
    ], 
    "description": "\n\n\n\nTest if an object has all of the specified fields. An object has a field if it has the\nspecified key and that key maps to a non-null value. For instance, the object\n`{'a':1,'b':2,'c': None}` has the fields `a` and `b`.\n\n\n\n\n\n\n\n\n\n"
  }, 
  "%": {
    "examples": [
      {
        "code": "(r.expr(2) % 2).run(conn)", 
        "description": "<p><strong>Example:</strong> It's as easy as 2 % 2 = 0.</p>"
      }
    ], 
    "name": "%", 
    "io": [
      [
        "number", 
        "number"
      ]
    ], 
    "description": "\n\n\n\nFind the remainder when dividing two numbers.\n\n\n`\n"
  }, 
  "[] (slice)": {
    "examples": [
      {
        "code": "r.table('marvel').order_by('strength')[5:10].run(conn)", 
        "description": "<p><strong>Example:</strong> For this fight, we need heroes with a good mix of strength and agility.</p>"
      }
    ], 
    "name": "[] (slice)", 
    "io": [
      [
        "sequence", 
        "stream"
      ], 
      [
        "array", 
        "array"
      ]
    ], 
    "description": "\n\n\n\nTrim the sequence to within the bounds provided.\n\n\n\n"
  }, 
  "concat_map": {
    "examples": [
      {
        "code": "r.table('marvel').concat_map(lambda hero: hero['defeatedMonsters']).run(conn)", 
        "description": "<p><strong>Example:</strong> Construct a sequence of all monsters defeated by Marvel heroes. Here the field\n'defeatedMonsters' is a list that is concatenated to the sequence.</p>"
      }
    ], 
    "name": "concat_map", 
    "io": [
      [
        "sequence", 
        "stream"
      ], 
      [
        "array", 
        "array"
      ]
    ], 
    "description": "\n\n\n\nFlattens a sequence of arrays returned by the mappingFunction into a single sequence.\n\n"
  }, 
  "-": {
    "examples": [
      {
        "code": "(r.expr(2) - 2).run(conn)", 
        "description": "<p><strong>Example:</strong> It's as easy as 2 - 2 = 0.</p>"
      }, 
      {
        "code": "r.now() - 365*24*60*60", 
        "description": "<p><strong>Example:</strong> Create a date one year ago today.</p>"
      }, 
      {
        "code": "r.now() - date", 
        "description": "<p><strong>Example:</strong> Retrieve how many seconds elapsed between today and date</p>"
      }
    ], 
    "name": "-", 
    "io": [
      [
        "number", 
        "number"
      ], 
      [
        "time", 
        "time"
      ], 
      [
        "time", 
        "number"
      ]
    ], 
    "description": "\n\n\n\nSubtract two numbers.\n\n\n\n\n\n\n"
  }, 
  "prepend": {
    "examples": [
      {
        "code": "r.table('marvel').get('IronMan')['equipment'].prepend('newBoots').run(conn)", 
        "description": "<p><strong>Example:</strong> Retrieve Iron Man's equipment list with the addition of some new boots.</p>"
      }
    ], 
    "name": "prepend", 
    "io": [
      [
        "array", 
        "array"
      ]
    ], 
    "description": "\n\n\n\nPrepend a value to an array.\n\n"
  }, 
  "inner_join": {
    "examples": [
      {
        "code": "r.table('marvel').inner_join(r.table('dc'), lambda marvelRow, dcRow:\n    marvelRow['strength'] < dcRow['strength']).run(conn)", 
        "description": "<p><strong>Example:</strong> Construct a sequence of documents containing all cross-universe matchups where a marvel hero would lose.</p>"
      }
    ], 
    "name": "inner_join", 
    "io": [
      [
        "sequence", 
        "stream"
      ], 
      [
        "array", 
        "array"
      ]
    ], 
    "description": "\n\n\n\nReturns the inner product of two sequences (e.g. a table, a filter result) filtered by\nthe predicate. The query compares each row of the left sequence with each row of the\nright sequence to find all pairs of rows which satisfy the predicate. When the predicate\nis satisfied, each matched pair of rows of both sequences are combined into a result row.\n\n"
  }, 
  "branch": {
    "examples": [
      {
        "code": "r.table('marvel').map(r.branch(r.row['victories'] > 100,\n    r.row['name'] + ' is a superhero',\n    r.row['name'] + ' is a hero')\n).run(conn)", 
        "description": "<p><strong>Example:</strong> Return the manlier of two heroes:</p>"
      }
    ], 
    "name": "branch", 
    "io": [
      [
        "r", 
        "any"
      ]
    ], 
    "description": "\n\n\n\nEvaluate one of two control paths based on the value of an expression. branch is effectively an if renamed due to language constraints.\n\nThe type of the result is determined by the type of the branch that gets executed.\n\n\n\n"
  }, 
  "type_of": {
    "examples": [
      {
        "code": "r.expr(\"foo\").type_of().run(conn)", 
        "description": "<p><strong>Example:</strong> Get the type of a string.</p>"
      }
    ], 
    "name": "type_of", 
    "io": [
      [
        "any", 
        "string"
      ]
    ], 
    "description": "\n\n\n\nGets the type of a value.\n\n\n\n"
  }, 
  "map": {
    "examples": [
      {
        "code": "r.table('marvel').map(lambda hero:\n    hero['combatPower'] + hero['compassionPower'] * 2\n).run(conn)", 
        "description": "<p><strong>Example:</strong> Construct a sequence of hero power ratings.</p>"
      }
    ], 
    "name": "map", 
    "io": [
      [
        "sequence", 
        "stream"
      ], 
      [
        "array", 
        "array"
      ]
    ], 
    "description": "\n\n\n\nTransform each element of the sequence by applying the given mapping function.\n\n\n\n"
  }, 
  "keys": {
    "examples": [
      {
        "code": "r.table('marvel').get('ironman').keys().run(conn)", 
        "description": "<p><strong>Example:</strong> Get all the keys of a row.</p>"
      }
    ], 
    "name": "keys", 
    "io": [
      [
        "singleSelection", 
        "array"
      ], 
      [
        "object", 
        "array"
      ]
    ], 
    "description": "\n\n\n\nReturn an array containing all of the object's keys.\n\n\n\n"
  }, 
  "update": {
    "examples": [
      {
        "code": "r.table('marvel').get('superman').update({ 'age': 30 }).run(conn)", 
        "description": "<p><strong>Example:</strong> Update Superman's age to 30. If attribute 'age' doesn't exist, adds it to\nthe document.</p>"
      }, 
      {
        "code": "r.table('marvel').update(lambda x: {'age': x['age'] + 1}, durability='soft').run(conn)", 
        "description": "<p><strong>Example:</strong> Increment every superhero's age. If age doesn't exist, throws an error. Specify soft durability.</p>"
      }, 
      {
        "code": "r.table('marvel').update(\n    lambda x: {'age': x['age'] + r.js('1')}, non_atomic=True\n).run(conn)", 
        "description": "<p><strong>Example:</strong> Allow the server to run non-atomic operations.</p>"
      }, 
      {
        "code": "r.table('marvel').get('superman').update({ 'age': 30 }, return_vals=True).run(conn)", 
        "description": "<p><strong>Example:</strong> You can get back a copy of the original row and the update row using the return_vals flag.</p>"
      }
    ], 
    "name": "update", 
    "io": [
      [
        "table", 
        "object"
      ], 
      [
        "selection", 
        "object"
      ], 
      [
        "singleSelection", 
        "object"
      ]
    ], 
    "description": "\n\n\n\nUpdate JSON documents in a table. Accepts a JSON document, a ReQL expression, or a\ncombination of the two. You can pass options like `returnVals` that will return the old\nand new values of the row you have modified.\n\nUpdate returns an object that contains the following attributes:\n\n- `replaced`: the number of documents that were updated\n- `unchanged`: the number of documents that would have been modified except the new\nvalue was the same as the old value;\n- `skipped`: the number of documents that were left unmodified because there was nothing\nto do: either the row didn't exist or the new value is `None`;\n- `errors`: the number of errors encountered while performing the update; if errors\noccured, first_error contains the text of the first error;\n- `deleted` and `inserted`: 0 for an update operation.\n\n\n\n\n\n\n\n\n"
  }, 
  "is_empty": {
    "examples": [
      {
        "code": "r.table('marvel').is_empty().run(conn)", 
        "description": "<p><strong>Example:</strong> Are there any documents in the marvel table?</p>"
      }
    ], 
    "name": "is_empty", 
    "io": [
      [
        "sequence", 
        "bool"
      ]
    ], 
    "description": "\n\n\n\nTest if a sequence is empty.\n\n\n\n"
  }, 
  "replace": {
    "examples": [
      {
        "code": "r.table('marvel').get('superman').replace({ 'id': 'superman', 'age': 30 }).run(conn)", 
        "description": "<p><strong>Example:</strong> Remove all existing attributes from Superman's document, and add an\nattribute 'age'.</p>"
      }, 
      {
        "code": "r.table('marvel').get('superman').replace(\n    { 'id': 'superman', 'age': 30 }, non_atomic=True\n).run(conn)", 
        "description": "<p><strong>Example:</strong> Allow the server to run non-atomic operations.</p>"
      }, 
      {
        "code": "r.table('heroes').filter(r.row['universe'] == 'marvel').replace(\n    lambda hero: hero.merge({'is_fav': True}), durability='soft'\n).run(conn)", 
        "description": "<p><strong>Example:</strong> Mark all Marvel heroes as favorites, specifying soft durability.</p>"
      }, 
      {
        "code": "r.table('heroes').filter(r.row['universe'] == 'marvel').replace(\n    lambda hero: hero.merge({'is_fav': True}), return_vals=True\n).run(conn)", 
        "description": "<p><strong>Example:</strong> You can get a copy of the previous value and the old value back using the\nreturn_vals flag.</p>"
      }
    ], 
    "name": "replace", 
    "io": [
      [
        "table", 
        "object"
      ], 
      [
        "selection", 
        "object"
      ], 
      [
        "singleSelection", 
        "object"
      ]
    ], 
    "description": "\n\n\n\nReplace documents in a table. Accepts a JSON document or a ReQL expression, and replaces\nthe original document with the new one. The new document must have the same primary key\nas the original document. The optional argument durability with value 'hard' or 'soft'\nwill override the table or query's default durability setting. The optional argument\nreturn_vals will return the old and new values of the row you're modifying when set to\ntrue (only valid for single-row replacements). The optional argument non_atomic lets you\npermit non-atomic updates.\n\nReplace returns an object that contains the following attributes:\n\n- `replaced`: the number of documents that were replaced\n- `unchanged`: the number of documents that would have been modified, except that the\nnew value was the same as the old value\n- `inserted`: the number of new documents added. You can have new documents inserted if\nyou do a point-replace on a key that isn't in the table or you do a replace on a\nselection and one of the documents you are replacing has been deleted\n- `deleted`: the number of deleted documents when doing a replace with `None` \n- `errors`: the number of errors encountered while performing the replace; if errors\noccurred performing the replace, first_error contains the text of the first error encountered\n- `skipped`: 0 for a replace operation\n\n\n\n\n\n\n\n\n"
  }, 
  "eq_join": {
    "examples": [
      {
        "code": "r.table('marvel').eq_join('main_dc_collaborator', r.table('dc')).run(conn)", 
        "description": "<p><strong>Example:</strong> Let our heroes join forces to battle evil!</p>"
      }, 
      {
        "code": "r.table('marvel').inner_join(r.table('dc'),\nlambda left, right: left['main_dc_collaborator'] == right['hero_name']).run(conn)", 
        "description": "<p><strong>Example:</strong> The above query is equivalent to this inner join but runs in O(n log(m))\ntime rather than the O(n * m) time the inner join takes.</p>"
      }, 
      {
        "code": "r.table('marvel').eq_join('main_weapon_origin',\nr.table('mythical_weapons'), index='origin').run(conn)", 
        "description": "<p><strong>Example:</strong> You can take advantage of a secondary index on the second table by giving\nan optional index parameter.</p>"
      }, 
      {
        "code": "r.table('marvel').eq_join(lambda doc:\n    doc['dc_collaborators'].order_by('appearances')[0]['name'],\n    r.table('dc')).run(conn)", 
        "description": "<p><strong>Example:</strong> You can pass a function instead of an attribute to join on more\ncomplicated expressions. Here we join to the DC universe collaborator with whom the hero\nhas the most appearances.</p>"
      }
    ], 
    "name": "eq_join", 
    "io": [
      [
        "sequence", 
        "stream"
      ], 
      [
        "array", 
        "array"
      ]
    ], 
    "description": "\n\n\n\nAn efficient join that looks up elements in the right table by primary key.\n\n\n\n\n\n\n\n"
  }, 
  "table_create": {
    "examples": [
      {
        "code": "r.db('test').table_create('dc_universe').run(conn)", 
        "description": "<p><strong>Example:</strong> Create a table named 'dc_universe' with the default settings.</p>"
      }, 
      {
        "code": "r.db('test').table_create('dc_universe', primary_key='name').run(conn)", 
        "description": "<p><strong>Example:</strong> Create a table named 'dc_universe' using the field 'name' as primary key.</p>"
      }, 
      {
        "code": "r.db('test').table_create('hero_actions', durability='soft').run(conn)", 
        "description": "<p><strong>Example:</strong> Create a table to log the very fast actions of the heroes.</p>"
      }
    ], 
    "name": "table_create", 
    "io": [
      [
        "db", 
        "table"
      ]
    ], 
    "description": "\n\n\n\nCreate a table. A RethinkDB table is a collection of JSON documents.\n\nIf successful, the operation returns an object: `{created: 1}`. If a table with the same\nname already exists, the operation throws `RqlRuntimeError`.\nNote: that you can only use alphanumeric characters and underscores for the table name.\n\nWhen creating a table you can specify the following options:\n\n- `primary_key`: the name of the primary key. The default primary key is id;\n- `durability`: if set to `soft`, this enables _soft durability_ on this table:\nwrites will be acknowledged by the server immediately and flushed to disk in the\nbackground. Default is `hard` (acknowledgement of writes happens after data has been\nwritten to disk);\n- `cache_size`: set the cache size (in bytes) to be used by the table. The\ndefault is 1073741824 (1024MB);\n- `datacenter`: the name of the datacenter this table should be assigned to.\n\n\n\n\n\n\n\n\n\n"
  }, 
  "date": {
    "examples": [
      {
        "code": "r.table(\"users\").filter(lambda user:\n    user[\"birthdate\"].date() == r.now().date()\n).run(conn)", 
        "description": "<p><strong>Example:</strong> Retrieve all the users whose birthday is today</p>"
      }
    ], 
    "name": "date", 
    "io": [
      [
        "time", 
        "time"
      ]
    ], 
    "description": "\n\n\n\nReturn a new time object only based on the day, month and year (ie. the same day at 00:00).\n\n\n\n"
  }, 
  "to_iso8601": {
    "examples": [
      {
        "code": "r.now().to_iso8601()", 
        "description": "<p><strong>Example:</strong> Return the current time in an ISO8601 format.</p>"
      }
    ], 
    "name": "to_iso8601", 
    "io": [
      [
        "time", 
        "string"
      ]
    ], 
    "description": "\n\n\n\nConvert a time object to its iso 8601 format.\n\n\n\n"
  }, 
  "set_union": {
    "examples": [
      {
        "code": "r.table('marvel').get('IronMan')['equipment'].set_union(['newBoots', 'arc_reactor']).run(conn)", 
        "description": "<p><strong>Example:</strong> Retrieve Iron Man's equipment list with the addition of some new boots and an arc reactor.</p>"
      }
    ], 
    "name": "set_union", 
    "io": [
      [
        "array", 
        "array"
      ]
    ], 
    "description": "\n\n\n\nAdd a several values to an array and return it as a set (an array with distinct values).\n\n\n"
  }, 
  "time_of_day": {
    "examples": [
      {
        "code": "r.table(\"posts\").filter(\n    r.row[\"date\"].time_of_day() <= 12*60*60\n).run(conn)", 
        "description": "<p><strong>Example:</strong> Retrieve posts that were submitted before noon.</p>"
      }
    ], 
    "name": "time_of_day", 
    "io": [
      [
        "time", 
        "number"
      ]
    ], 
    "description": "\n\n\n\nReturn the number of seconds elapsed since the beginning of the day stored in the time object.\n\n\n\n"
  }, 
  "without": {
    "examples": [
      {
        "code": "r.table('marvel').get('IronMan').without('personalVictoriesList').run(conn)", 
        "description": "<p><strong>Example:</strong> Since we don't need it for this computation we'll save bandwidth and leave\nout the list of IronMan's romantic conquests.</p>"
      }, 
      {
        "code": "r.table('enemies').without('weapons').run(conn)", 
        "description": "<p><strong>Example:</strong> Without their prized weapons, our enemies will quickly be vanquished.</p>"
      }, 
      {
        "code": "r.table('marvel').without({'weapons' : {'damage' : True}, 'abilities' : {'damage' : True}}).run(conn)", 
        "description": "<p><strong>Example:</strong> Nested objects can be used to remove the damage subfield from the weapons and abilities fields.</p>"
      }, 
      {
        "code": "r.table('marvel').without({'weapons' : 'damage', 'abilities' : 'damage'}).run(conn)", 
        "description": "<p><strong>Example:</strong> The nested syntax can quickly become overly verbose so there's a shorthand for it.</p>"
      }
    ], 
    "name": "without", 
    "io": [
      [
        "sequence", 
        "stream"
      ], 
      [
        "array", 
        "array"
      ], 
      [
        "object", 
        "object"
      ], 
      [
        "singleSelection", 
        "object"
      ]
    ], 
    "description": "\n\n\n\nThe opposite of pluck; takes an object or a sequence of objects, and returns them with\nthe specified paths removed.\n\n\n\n\n\n\n\n\n"
  }, 
  "time": {
    "examples": [
      {
        "code": "r.table(\"user\").get(\"John\").update({\"birthdate\": r.time(1986, 11, 3, 'Z')}).run(conn)", 
        "description": "<p><strong>Example:</strong> Update the birthdate of the user \"John\" to November 3rd, 1986 UTC.</p>"
      }
    ], 
    "name": "time", 
    "io": [
      [
        "r", 
        "time"
      ]
    ], 
    "description": "\n\n\n\nCreate a time object for a specific time.\n\nA few restrictions exist on the arguments:\n\n- `year` is an integer between 1400 and 9,999.\n- `month` is an integer between 1 and 12.\n- `day` is an integer between 1 and 31.\n- `hour` is an integer.\n- `minutes` is an integer.\n- `seconds` is a double. Its value will be rounded to three decimal places\n(millisecond-precision).\n- `timezone` can be `'Z'` (for UTC) or a string with the format `\u00b1[hh]:[mm]`.\n\n\n\n\n"
  }, 
  "splice_at": {
    "examples": [
      {
        "code": "r.expr([\"Iron Man\", \"Spider-Man\"]).splice_at(1, [\"Hulk\", \"Thor\"]).run(conn)", 
        "description": "<p><strong>Example:</strong> Hulk and Thor decide to join the avengers.</p>"
      }
    ], 
    "name": "splice_at", 
    "io": [
      [
        "array", 
        "array"
      ]
    ], 
    "description": "\n\n\n\nInsert several values in to an array at a given index. Returns the modified array.\n\n"
  }, 
  "sum": {
    "examples": [
      {
        "code": "r.table('marvel').group_by('strength', r.sum('enemiesVanquished')).run(conn)", 
        "description": "<p><strong>Example:</strong> How many enemies have been vanquished by heroes at each strength level?</p>"
      }
    ], 
    "name": "sum", 
    "io": [
      [
        "r", 
        null
      ]
    ], 
    "description": "\n\n\n\nCompute the sum of the given field in the group.\n\n"
  }
}