5n       !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~                                !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~                                                                                                                               ! " # $ % & ' ( ) * + , - . / 0 1 2 3 4 5 6 7 8 9 : ; < = > ? @ A B C D E F G H I JK L M N O P Q R S T U V W X Y Z [ \ ] ^ _ ` a b c d e f g h i j k l m n o p q r s t u v w x y z { | } ~                                                                                                                                  !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~SafeSafe     SafeSafe   Safe#$%&'()*+,-./0123456789:;<#$%&'()*+,-./0162345789123456789<)*+,-./0;#$%&'(:#$%&'()*+,-./0123456789:;<SafeCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~CSQUIDEFGHJKLMNOPRTVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~CDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~CDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ Safe   SafeA table description +when Nothing, use the connection's database A database, referenced by name                       None69;M. A ReQL value !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~+ !"#$%&'()*+,-.943120/5678:;<=>?@ABC-./0123456789,--: !"#+*'()$%&;<=>?@ABCp !"#$%&'()*+,--. /0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ None!"%&69;ACMT)Convert other types into ReQL expressions A ReQL Term.An upper or lower bound for between and duringAn inclusive boundAn exclusive bound*A key/value pair used for building objectsBuild arrays of exprsA list of terms,An operation that accepts optional arguments+Extend an operation with optional argumentsState used to build a Term(A term ready to be sent over the network&Internal representation of a ReQL Term Build a termBuild a term with no optargsnA shortcut for inserting strings into ReQL expressions Useful when OverloadedStrings makes the type ambiguous6A shortcut for inserting numbers into ReQL expressionsAn empty objectAdd a note a a ReQL TermaThis note does not get sent to the server. It is used to annotate backtraces and help debugging.      !"#$%&'()*+,-.FI|       !"#$%&'()*+,-.0 None8$Convert a line object into a polygon6run' h $ fill $ line [[-122,37], [-120,39], [-121,38]]2Polygon<[[-122,37],[-120,39],[-121,38],[-122,37]]>99Convert a GeoJSON object into a RethinkDB geometry object?run' h $ geoJSON ["type" := "Point", "coordinates" := [-45,80]] Point<-45,80>:9Convert a RethinkDB geometry object into a GeoJSON object2run' h $ toGeoJSON $ point (-122.423246) 37.7793886{"coordinates":[-122.423246,37.779388],"type":"Point"};2Search a geospatial index for intersecting objectsIrun' h $ table "places" # getIntersecting (point (-122) 37) (Index "geo")[]<0Query a geospatial index for the nearest matchesIrun' h $ table "places" # getNearest (point (-122) 37) (Index "location")[]wrun' h $ table "places" # ex getNearest [maxResults 5, maxDist 10, unit Kilometer] (point (-122) 37) (Index "location")[]=/Test whether a geometry object includes anotherCrun' h $ circle (point (-122) 37) 5000 # includes (point (-120) 48)false>'Test if two geometry objects intersectsMrun' h $ intersects (line [[-122,37],[-120,48]]) (line [[-120,49],[-122,48]])false?Create a line object"run' h $ line [[-73,45],[-122,37]]Line<[-73,45],[-122,37]>@Create a point objectsrun' h $ point (-73) 40 Point<-73,40>ACreate a polygon object.run' h $ polygon [[-73,45],[-122,37],[-73,40]]/Polygon<[[-73,45],[-122,37],[-73,40],[-73,45]]>BPunch a hole in a polygonprun' h $ (polygon [[-73,45],[-122,37],[-73,40]]) # polygonSub (polygon [[-73.2,40.1],[-73.2,40.2],[-73.3,40.1]])ePolygon<[[-73,45],[-122,37],[-73,40],[-73,45]],[[-73.2,40.1],[-73.2,40.2],[-73.3,40.1],[-73.2,40.1]]>C'Create a polygon approximating a circleGrun' h $ ex circle [numVertices 6, unit Kilometer] (point (-73) 40) 100Polygon<[[-73,39.099310036015424],[-74.00751390838496,39.54527799206398],[-74.02083610406069,40.445812561599965],[-73,40.900549591978255],[-71.97916389593931,40.445812561599965],[-71.99248609161504,39.54527799206398],[-73,39.099310036015424]]>D4Distance between a point and another geometry object 4run' h $ distance (point (-73) 40) (point (-122) 37) P467303546 > run' h $ ex distance [unit Mile] (point (-73) 40) (point (-122) 37) 5460282596796E Optional argument for getNearestF Optional argument for getNearestG5Optional argument for getNearest, circle and distanceHOptional argument for circle23456789:;<=>?@ABCDEFGHI23456789:;<=>?@ABCDEFGH89:;<=>?@ABCDEFGH234567I23456789:;<=>?@ABCDEFGHI None%&9;(Apply a function to a list of arguments.Called do in the official drivers#run h $ (\x -> x R.* 2) `apply` [4]8 Evaluate a JavaScript expressionrun' h $ js "Math.PI"3.141592653589793'let r_sin x = js "Math.sin" `apply` [x]run h $ R.map r_sin [pi, pi/2] [1.2246...,1]lCreate a table on the server k>>> run' h $ tableCreate (table "posts") def [{"created":1}] >>> run' h $ tableCreate (table "users"){ tablePrimaryKey = Just "name" } def [{"created":1}] >>> run' h $ tableCreate (Table (Just "doctests") "bar" (Just "name")) def [{"created":1}] >>> run' h $ ex tableCreate ["datacenter":="orion"] (Table (Just "doctests") "bar" (Just "name")) def [{"created":1}]m5Insert a document or a list of documents into a tablemrun h $ table "users" # insert (map (\x -> ["name":=x]) ["bill", "bob", "nancy" :: Text]) :: IO WriteResponse {inserted:3}mrun h $ table "posts" # insert ["author" := str "bill", "message" := str "hi", "id" := 1] :: IO WriteResponse {inserted:1}run h $ table "posts" # insert ["author" := str "bill", "message" := str "hello", "id" := 2, "flag" := str "deleted"] :: IO WriteResponse {inserted:1}run h $ table "posts" # insert ["author" := str "bob", "message" := str "lorem ipsum", "id" := 3, "flag" := str "pinned"] :: IO WriteResponse {inserted:1}n+Add to or modify the contents of a documenturun h $ table "users" # getAll "name" [str "bob"] # update (const ["occupation" := str "tailor"]) :: IO WriteResponse {replaced:1}oReplace a document with anotherrun h $ replace (\user -> ["name" := user!"name", "occupation" := str "clothier"]) . R.filter ((R.== str "tailor") . (!?"occupation")) $ table "users" :: IO WriteResponse {replaced:1}pDelete the documentsNrun h $ delete . getAll "name" [str "bob"] $ table "users" :: IO WriteResponse {deleted:1}qLike map but for write queries>_ <- run' h $ table "users" # replace (without ["post_count"])run h $ forEach (\user -> table "users" # get (user!"name") # ex update [nonAtomic] (const ["post_count" := R.count (table "posts" # R.filter (\post -> post!"author" R.== user!"name"))])) (table "users") :: IO WriteResponse {replaced:2}rA table/fmap sort $ run h $ table "users" :: IO [Datum]@[{"post_count":2,"name":"bill"},{"post_count":0,"name":"nancy"}]s Drop a table run' h $ tableDrop (table "foo"){"config_changes":[{"new_val":null,"old_val":{"primary_key":"id","write_acks":"majority","durability":"hard","name":"foo","shards":...,"id":...,"db":"doctests"}}],"tables_dropped":1}tList the tables in a database<fmap sort $ run h $ tableList (db "doctests") :: IO [String]["places","posts","users"]uAddition or concatenation.Use the Num instance, or a qualified operator. run h $ 2 + 57run h $ str "foo" R.+ str "bar""foobar"v Subtraction run h $ 2 - 5-3wMultiplication run h $ 2 * 510xDivisionrun h $ 2 R./ 50.4yModrun h $ 5 `mod` 21z Boolean orrun h $ True R.|| Falsetrue{ Boolean andrun h $ True R.&& Falsefalse|Test for equality"run h $ ["a" := 1] R.== ["a" := 1]true}Test for inequalityrun h $ 1 R./= Falsetrue~ Greater thanrun h $ 3 R.> 2true Lesser thanrun h $ (str "a") R.< (str "b")trueGreater than or equal torun h $ [1] R.>= NullfalseLesser than or equal torun h $ 2 R.<= 2trueNegationrun h $ R.not Falsetruerun h $ R.not Nulltrue#The size of a sequence or an array.run h $ count (table "users")2Join two sequences./run h $ [1,2,3] `union` ["a", "b", "c" :: Text][1,2,3,"a","b","c"]Map a function over a sequence-run h $ R.map (!"a") [["a" := 1], ["a" := 2]][1,2]#Filter a sequence given a predicate1run h $ R.filter (R.< 4) [3, 1, 4, 1, 5, 9, 2, 6] [3,1,1,2]KQuery all the documents whose value for the given index is in a given rangeJrun h $ table "users" # between "name" (Closed $ str "a") (Open $ str "c") [{"post_count":2,"name":"bill"}]Append a datum to a sequencerun h $ append 3 [1, 2][1,2,3]3Map a function of a sequence and concat the results*run h $ concatMap id [[1, 2], [3], [4, 5]] [1,2,3,4,5]$SQL-like inner join of two sequencessorted $ run' h $ innerJoin (\user post -> user!"name" R.== post!"author") (table "users") (table "posts") # R.zip # orderBy [asc "id"] # pluck ["name", "message"]B[{"name":"bill","message":"hello"},{"name":"bill","message":"hi"}]$SQL-like outer join of two sequencessorted $ run' h $ outerJoin (\user post -> user!"name" R.== post!"author") (table "users") (table "posts") # R.zip # orderBy [asc "id", asc "name"] # pluck ["name", "message"]S[{"name":"bill","message":"hello"},{"name":"bill","message":"hi"},{"name":"nancy"}]\An efficient inner_join that uses a key for the left table and an index for the right table.sorted $ run' h $ table "posts" # eqJoin "author" (table "users") "name" # R.zip # orderBy [asc "id"] # pluck ["name", "message"]B[{"name":"bill","message":"hello"},{"name":"bill","message":"hi"}]*Drop elements from the head of a sequence.run h $ skip 2 [1, 2, 3, 4][3,4]Limit the size of a sequence.run h $ limit 2 [1, 2, 3, 4][1,2]Cut out part of a sequence!run h $ slice 2 4 [1, 2, 3, 4, 5][3,4]Get nth element of a sequencerun h $ nth 2 [1, 2, 3, 4, 5]3#Reduce a sequence to a single valuerun h $ reduce0 (+) 0 [1, 2, 3]6-Reduce a non-empty sequence to a single valuerun h $ reduce (+) [1, 2, 3]6-Filter out identical elements of the sequenceDfmap sort $ run h $ distinct (table "posts" ! "flag") :: IO [String]["deleted","pinned"]EMerge the "left" and "right" attributes of the objects in a sequence.`fmap sort $ run h $ table "posts" # eqJoin "author" (table "users") "name" # R.zip :: IO [Datum][{"post_count":2,"flag":"deleted","name":"bill","author":"bill","id":2,"message":"hello"},{"post_count":2,"name":"bill","author":"bill","id":1,"message":"hi"}]"Order a sequence by the given keys_run' h $ table "users" # orderBy [desc "post_count", asc "name"] # pluck ["name", "post_count"]@[{"post_count":2,"name":"bill"},{"post_count":0,"name":"nancy"}]Irun' h $ table "users" # ex orderBy ["index":="name"] [] # pluck ["name"]"[{"name":"bill"},{"name":"nancy"}]Ascending orderDescending orderUTurn a grouping function and a reduction function into a grouped map reduce operationtrun' h $ table "posts" # orderBy [asc "id"] # group (!"author") (reduce (\a b -> a + "\n" + b) . R.map (!"message"))T[{"group":"bill","reduction":"hi\nhello"},{"group":"bob","reduction":"lorem ipsum"}]|run' h $ table "users" # group ((!0) . splitOn "" . (!"name")) (\users -> let pc = users!"post_count" in [avg pc, R.sum pc])A[{"group":"b","reduction":[2,2]},{"group":"n","reduction":[0,0]}]>Rewrite multiple reductions into a single map/reduce operationThe sum of a sequencerun h $ sum [1, 2, 3]6The average of a sequencerun h $ avg [1, 2, 3, 4]2.5 Minimum value!Value that minimizes the function Minimum value%Floor rounds number to interger belowrun h $ R.floor 2.92#Ceil rounds number to integer aboverun h $ R.ceil 2.13&Round rounds number to nearest integerrun h $ R.round 2.53!Value that maximizes the function;Get a single field from an object or an element of an arrayrun h $ ["foo" := True] ! "foo"truerun h $ [1, 2, 3] ! 010Or a single field from each object in a sequence3run h $ [["foo" := True], ["foo" := False]] ! "foo" [true,false]*Get a single field, or null if not presentrun' h $ empty !? "foo"nullKeep only the given attributesOrun' h $ [["a" := 1, "b" := 2], ["a" := 2, "c" := 7], ["b" := 4]] # pluck ["a"][{"a":1},{"a":2},{}]*Remove the given attributes from an objectQrun' h $ [["a" := 1, "b" := 2], ["a" := 2, "c" := 7], ["b" := 4]] # without ["a"][{"b":2},{"c":7},{"b":4}]+Test if a sequence contains a given elementrun' h $ [1,2,3] # contains 1trueMerge two objects together8run' h $ merge ["a" := 1, "b" := 1] ["b" := 1, "c" := 2]{"a":1,"b":1,"c":2}ELiteral objects, in a merge or update, are not processed recursively.@run' h $ ["a" := ["b" := 1]] # merge ["a" := literal ["c" := 2]] {"a":{"c":2}}*Remove fields when doing a merge or update4run' h $ ["a" := ["b" := 1]] # merge ["a" := remove]{}Server-side ifrun h $ branch (1 R.< 2) 3 43Abort the query with an error'run' h $ R.error (str "haha") R./ 2 + 1-*** Exception: RethinkDB: Runtime error: haha- in add(div({- HERE -} error("haha"), 2), 1)Create a Database referencerun' h $ db "test" # info${"name":"test","id":...,"type":"DB"}Create a database on the serverrun' h $ dbCreate "dev"W{"config_changes":[{"new_val":{"name":"dev","id":...},"old_val":null}],"dbs_created":1}Drop a databaserun' h $ dbDrop (db "dev")j{"config_changes":[{"new_val":null,"old_val":{"name":"dev","id":...}}],"tables_dropped":0,"dbs_dropped":1} List the databases on the server_ <- run' h $ dbList4Create an index on the table from the given functionArun' h $ table "users" # indexCreate "occupation" (!"occupation") {"created":1}Nrun' h $ table "users" # ex indexCreate ["multi":=True] "friends" (!"friends") {"created":1}Nrun' h $ table "users" # ex indexCreate ["geo":=True] "location" (!"location") {"created":1}#Get the status of the given indexes 'run' h $ table "users" # indexStatus []Wait for an index to be built %run' h $ table "users" # indexWait []EEnsures that writes on a given table are written to permanent storagerun' h $ sync (table "users") {"synced":1}List the indexes on the table"run' h $ indexList (table "users")#["friends","location","occupation"] Drop an index/run' h $ table "users" # indexDrop "occupation" {"dropped":1})Retreive documents by their indexed value7run' h $ table "users" # getAll PrimaryKey [str "bill"] [{"post_count":2,"name":"bill"}]Get a document by primary key$run' h $ table "users" # get "nancy"{"post_count":0,"name":"nancy"}#Convert a value to a different typerun h $ coerceTo "STRING" 1"1"Convert a value to an array<run h $ asArray $ ["a" := 1, "b" := 2] :: IO [(String, Int)][("a",1),("b",2)]Convert a value to a string'run h $ asString $ ["a" := 1, "b" := 2]"{\"a\":1,\"b\":2}"Convert a value to a numberrun h $ asNumber (str "34")34Convert a value to an object)run' h $ asObject $ [(str "a",1),("b",2)] {"a":1,"b":2}Convert a value to a boolean Like hasFields followed by pluckTrun' h $ [["a" := 1, "b" := 2], ["a" := 2, "c" := 7], ["b" := 4]] # withFields ["a"][{"a":1},{"a":2}]EThe position in the sequence of the elements that match the predicate9run h $ indexesOf (match "ba.") [str "foo", "bar", "baz"][1,2]Test if a sequence is emptyrun h $ isEmpty [1]falseRSelect a given number of elements from a sequence with uniform random distribution,_ <- run' h $ sample 3 [0,1,2,3,4,5,6,7,8,9]Prepend an element to an arrayrun h $ prepend 1 [2,3][1,2,3]The different of two lists&run h $ [1,2,3,4,5] # difference [2,5][1,3,4]5Insert a datum into an array if it is not yet presentrun h $ setInsert 3 [1,2,4,4,5] [1,2,4,5,3]The union of two setsrun h $ [1,2] `setUnion` [2,3][2,3,1]The intersection of two sets%run h $ [1,2] `setIntersection` [2,3][2]The difference of two sets#run h $ [2,3] # setDifference [1,2][3]&Test if an object has the given fields"run h $ hasFields "a" $ ["a" := 1]true0Insert a datum at the given position in an arrayrun h $ insertAt 1 4 [1,2,3] [1,4,2,3]8Splice an array at a given position inside another array run h $ spliceAt 2 [4,5] [1,2,3] [1,2,4,5,3]Delete an element from an arrayrun h $ deleteAt 1 [1,2,3][1,3]Change an element in an arrayrun h $ changeAt 1 4 [1,2,3][1,4,3]$The list of keys of the given object!run h $ keys ["a" := 1, "b" := 2] ["a","b"]&The list of values of the given object#run h $ values ["a" := 1, "b" := 2][1,2]'Match a string to a regular expression.-run' h $ str "foobar" # match "f(.)+[bc](.+)"j{"groups":[{"start":2,"end":3,"str":"o"},{"start":4,"end":6,"str":"ar"}],"start":0,"end":6,"str":"foobar"}'Catch some expections inside the query.Called default in the official drivers-run h $ R.handle (const 0) $ ["a" := 1] ! "b"0/run h $ R.handle (expr . id) $ ["a" := 1] ! "b"0"No attribute `b` in object:\n{\n\t\"a\":\t1\n}"/A string representing the type of an expressionrun h $ typeOf 1"NUMBER"GGet information on a given expression. Useful for tables and databases.run h $ info $ table "users"{"primary_key":"name","doc_count_estimates":...,"name":"users","id":...,"indexes":["friends","location"],"type":"TABLE","db":{"name":"doctests","id":...,"type":"DB"}}"Parse a json string into an objectrun' h $ json "{\"a\":1}"{"a":1}Flipped function applicationConvert to upper caserun h $ upcase (str "Foo")"FOO"Convert to lower caserun h $ downcase (str "Foo")"foo"'Split a string on whitespace charactersrun' h $ split (str "foo bar") ["foo","bar"]#Split a string on a given delimiter%run' h $ str "foo, bar" # splitOn ","["foo"," bar"]run' h $ str "foo" # splitOn "" ["f","o","o"],Split a string up to a given number of times'run' h $ str "a:b:c:d" # splitMax ":" 2["a","b","c:d"]A random float between 0 and 17run' h $ (\x -> x R.< 1 R.&& x R.>= 0) `apply` [random]trueA random number between 0 and n=run' h $ (\x -> x R.< 10 R.&& x R.>= 0) `apply` [randomTo 10]trueA random number between 0 and nCrun' h $ (\x -> x R.< 10 R.&& x R.>= 5) `apply` [randomFromTo 5 10]true.Retrieve data from the specified URL over HTTPQ_ <- run' h $ http "http://httpbin.org/get" def{ httpParams = Just ["foo" := 1] }q_ <- run' h $ http "http://httpbin.org/put" def{ httpMethod = Just PUT, httpData = Just $ expr ["foo" := "bar"] }-Splice a list of values into an argument listDReturn an infinite stream of objects representing changes to a table>cursor <- run h $ table "posts" # changes :: IO (Cursor Datum)frun h $ table "posts" # insert ["author" := "bill", "message" := "bye", "id" := 4] :: IO WriteResponse {inserted:1} next cursorHJust {"new_val":{"author":"bill","id":4,"message":"bye"},"old_val":null}OOptional argument for returning an array of objects describing the changes made[run h $ table "users" # ex insert [returnChanges] ["name" := "sabrina"] :: IO WriteResponseD{inserted:1,changes:[{"old_val":null,"new_val":{"name":"sabrina"}}]}Optional argument for changesOptional argument for changes'Optional argument for non-atomic writesRrun' h $ table "users" # get "sabrina" # update (merge ["lucky_number" := random])|*** Exception: RethinkDB: Runtime error: Could not prove argument deterministic. Maybe you want to use the non_atomic flag? in {- HERE -} update(5 get(table(db("doctests"), "users"), "sabrina"),1 (\b -> merge(b, {lucky_number: random()})))trun h $ table "users" # get "sabrina" # ex update [nonAtomic] (merge ["lucky_number" := random]) :: IO WriteResponse {replaced:1}Generate a UUID run h uuid"...-...-...-..."Generate a Version 5 UUIDrun h $ uuid5 "foo"&"aa32a020-8c2d-5ff1-823b-ad3fa5d067eb" Generate numbers starting from 0run h $ range 10[0,1,2,3,4,5,6,7,8,9]Generate numbers within a rangerun h $ rangeFromTo 2 4[2,3] Generate numbers starting from 0run' h $ rangeAll # limit 4 [0,1,2,3]Wait for tables to be readyrun h $ table "users" # wait {"ready":1}+Convert an object or value to a JSON stringrun h $ toJSON "a""\"a\""Map over two sequencesrun h $ zipWith (+) [1,2] [3,4][4,6]Map over multiple sequencesBrun' h $ zipWithN (\a b c -> expr $ a + b * c) [[1,2],[3,4],[5,6]][16,26]Change a table's configuration'run h $ table "users" # reconfigure 2 1{{"config_changes":[{"new_val":{"primary_key":"name","write_acks":"majority","durability":"hard","name":"users","shards":...Rebalance a table's shards!run h $ table "users" # rebalanceo{"rebalanced":1,"status_changes":[{"new_val":{"status":{"all_replicas_ready":...,"ready_for_outdated_reads":...&Get the config for a table or databaserun h $ table "users" # configw{"primary_key":"name","write_acks":"majority","durability":"hard","name":"users","shards":...,"id":...,"db":"doctests"}Get the status of a tablerun h $ table "users" # statusH{"status":{"all_replicas_ready":true,"ready_for_outdated_reads":true,...KLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~KLMNOPQRSWTUVXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~lmnopqrstuvwxyz{|}~^_`abcdefghijkYZ[\]RSTUVWXOPQKLMNKLMNOPQRSTUVWXYZ[\]^ _`abcdefghijklmnopqrstuvwxyz{|}~u6v6w7x7z2{3|4}4~44449 8None!"#0M The response to a query#A connection to the database serverThe next token to useThe default database.Create a new connection to the database serverExample:4 connect using the default port with no passphrase (note: IPv4 and IPv6 supported)&h <- connect "localhost" 28015 Nothing $>>> h <- connect "::1" 28015 NothingSet the default databaseYThe new handle is an alias for the old one. Calling close on either one will close both.Close an open connection Get the next value from a cursor  Get the next batch from a cursor!/A lazy stream of all the elements in the cursor"A strict version of collect#2Wait for NoReply queries to complete on the servern() <- runOpts h [NoReply] $ table "users" # get "bob" # update (\row -> merge row ["occupation" := "teacher"]) noReplyWait h% Get information about the serverN      !"#$%&'()*+,-,      !"#$%,   !"   #$%/      !"#$%&'()*+,-None%&69;?1Convert the raw query response into useful valuesDPer-query settingsE+Deprecated. Use `ReadMode Outdated` insteadK,Optional argument for soft durability writesL"Run a query with the given optionsM%Run a given query and return a Resultrun h $ num 1 :: IO Int1 7>>> run h $ str "foo" :: IO (Either RethinkDBError Int)P** Exception: RethinkDB: Unexpected response: "expected Int, encountered String"#run h $ str "foo" :: IO (Maybe Int)Nothing >>> run h $ str "foo" :: IO IntP** Exception: RethinkDB: Unexpected response: "expected Int, encountered String"Qc <- run h $ table "users" # orderBy [asc "name"] # (!"name"):: IO (Cursor Datum)next c Just "bill" collect c["nancy","sabrina"]N$Run a given query and return a DatumV0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}0123456789:;<=>?@ABCDFHEGIJKLMN MN?@@LDEFGHIJABCK456789:;<=>0123=01234 56789:;<=>?@@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}None~,The time and date when the query is executed >>> run' h $ nowWBuild a time object from the year, month, day, hour, minute, second and timezone fields%run' h $ time 2011 12 24 23 59 59 "Z"Time<2011-12-24 23:59:59 +0000>DBuild a time object given the number of seconds since the unix epochrun' h $ epochTime 1147162826Time<2006-05-09 08:20:26 +0000>+Build a time object given an iso8601 string+run' h $ iso8601 "2012-01-07T08:34:00-0700"Time<2012-01-07 08:34:00 -0700>%The same time in a different timezone$_ <- run' h $ inTimezone "+0800" now)Test if a time is between two other timesLrun' h $ during (Open $ now R.- (60*60)) (Closed now) $ epochTime 1382919271falseExtract part of a time valueExtract part of a time valueExtract part of a time valueExtract part of a time valueExtract part of a time valueExtract part of a time valueExtract part of a time valueExtract part of a time valueExtract part of a time valueExtract part of a time valueExtract part of a time value(Convert a time to another representation(Convert a time to another representation~~~~NoneF      !"#$%&'(),-.943120/5678:23456789:;<=>?@ABCDEFGHKLMNOPQRSWTUVXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~  !"#$%0123456789:;<=>?@ADFHEGIJKLMN~L%MNL./0123456789,--:DEFGHIJ# ?@@!"$      lst456789:;<=>0123mnopKAKLMNruvwxy{z|}~~q^_`abcdefghijkYZ[\]RSTUVWXOPQCD89:;<=>?@AB !"#'()$%&EFGH234567None,      !"#$%&'(),-.943120/5678:23456789:;<=>?@ABCDEFGHKLMNOPQRSWTUVXYZ[\]^_`abcdefghijklmnopqrst  !"#$%0123456789:;<=>?@ADFHEGIJKLMN~None5      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~      !"#$%&'(),-.943120/5678:23456789:;<=>?@ABCDEFGHKLMNOPQRSWTUVXYZ[\]^_`abcdefghijklmnopqrst  !"#$%0123456789:;<=>?@ADFHEGIJKLMN~NoneMJTakes a function that takes a sequence as an argument, and returns a function that only uses that sequence once, by merging the map and reduce operations. This is used by groupBy.A built-in map operationRA Chain of ReQL expressions that might be transformed into a map/reduce operation-A constant, not really a map/reduce operation Just a map*map/reduce operations represented as partsA rewritten map/reduce"Special cases for reduce with baseERepresents a map/reduce operation split into its map and reduce parts.Compares the two representations of a variable9notNone checks that it is a map/reduce and not a constant2Helper function for casting up from Term into ReQL@Build a single argument function from a constant ReQL expression=Build a two argument function from a constant ReQL expression)Convert a Chain back into a ReQL function#Convert an MRF into a ReQL functiontRewrites the term in the second argument to merge all uses of the variable whose id is given in the first argument./Chain a ReQL command onto a MapReduce operation*Convert some builtin operations into a map9Convert some of the built-in operations into a map/reduce TODO: these have not been tested,Convert from one representation to the otherWThis undocumented optional argument circumvents stream polymorphism on some operations$Rewrite a command into a map/reduce.QThis is a special case for when only one of the arguments is itself a map/reducepRewrite a command that combines the result of multiple map/reduce operations into a single map/reduce operationExtract the inner map/reduce objects, also returning a function which, given the result of all the map/reduce operations, returns the result of the given command1J1J1J"J !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLM7NOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~                           ! ! " # $ % & ' ( ) * + , - . / 0123345667889:;<=>?@AB;:CDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~                                          >        .                                                                       ! " # $ % & ' ( ) * + , - . / 0 1 2 3 4 5 6 7 8 9 : ; < = > ? @ A B C D E F G H I J K L M N O PQ R  S T U V W X f Y Z [  \ ] ^ _ ` a b b c d e f g h i j k l m n o p q r s t u v w x y z { | } ~                                                                                                                                      !"#$%&'()*+,-.//01223456789:;<=>?@ABC=DEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~                      B      !"#$%&'{()*+,-|./01234567898z8x8y8:8;8<8=>?@A@B@CDEFGHIJKLMNOPQRSTUVWXYZY[Y\Y]^_`abcdcecfcgchcicjcckclcmcncopqprpsptpuvwxyz@z{z|z}z~zzzzjzhzlzzAccccccccc@@YYYYY8~}(rethinkdb-2.2.0.8-GlsQrysVczKAiWkegIC70fDatabase.RethinkDB.DatumDatabase.RethinkDBDatabase.RethinkDB.WireDatabase.RethinkDB.Wire.DatumDatabase.RethinkDB.Wire.FrameDatabase.RethinkDB.Wire.Query Database.RethinkDB.Wire.ResponseDatabase.RethinkDB.Wire.Term$Database.RethinkDB.Wire.VersionDummyDatabase.RethinkDB.TypesDatabase.RethinkDB.ReQLDatabase.RethinkDB.FunctionsDatabase.RethinkDB.GeospatialDatabase.RethinkDB.MapReduceDatabase.RethinkDB.NetworkDatabase.RethinkDB.DriverDatabase.RethinkDB.TimeDatabase.RethinkDB.DoctestDatabase.RethinkDB.NoClash$aeson-1.1.0.0-GPgrXYDUUw0IqAWVUydqJYData.Aeson.Types.InternalparseSuccessErrorResultParser1data-default-class-0.1.2.0-FYQpjIylblBDctdkHAFeXAData.Default.Classdef WireValuetoWirefromWire DatumTypeR_NULLR_BOOLR_NUMR_STRR_ARRAYR_OBJECTR_JSON$fWireValueDatumType $fEqDatumType$fShowDatumType FrameTypePOSOPT$fWireValueFrameType $fEqFrameType$fShowFrameType QueryTypeSTARTCONTINUESTOP NOREPLY_WAIT SERVER_INFO$fWireValueQueryType $fEqQueryType$fShowQueryType ResponseNote SEQUENCE_FEED ATOM_FEEDORDER_BY_LIMIT_FEED UNIONED_FEEDINCLUDES_STATES ErrorTypeINTERNALRESOURCE_LIMIT QUERY_LOGIC NON_EXISTENCE OP_FAILEDOP_INDETERMINATEUSER ResponseType SUCCESS_ATOMSUCCESS_SEQUENCESUCCESS_PARTIAL WAIT_COMPLETE CLIENT_ERROR COMPILE_ERROR RUNTIME_ERROR$fWireValueResponseNote$fWireValueErrorType$fWireValueResponseType$fEqResponseType$fShowResponseType $fEqErrorType$fShowErrorType$fEqResponseNote$fShowResponseNoteTermTypeDATUM MAKE_ARRAYMAKE_OBJVAR JAVASCRIPTUUIDHTTPERROR IMPLICIT_VARDBTABLEGETGET_ALLEQNELTLEGTGENOTADDSUBMULDIVMODFLOORCEILROUNDAPPENDPREPEND DIFFERENCE SET_INSERTSET_INTERSECTION SET_UNIONSET_DIFFERENCESLICESKIPLIMIT OFFSETS_OFCONTAINS GET_FIELDKEYSVALUESOBJECT HAS_FIELDS WITH_FIELDSPLUCKWITHOUTMERGEBETWEEN_DEPRECATEDBETWEENREDUCEMAPFILTER CONCAT_MAPORDER_BYDISTINCTCOUNTIS_EMPTYUNIONNTHBRACKET INNER_JOIN OUTER_JOINEQ_JOINZIPRANGE INSERT_AT DELETE_AT CHANGE_AT SPLICE_AT COERCE_TOTYPE_OFUPDATEDELETEREPLACEINSERT DB_CREATEDB_DROPDB_LIST TABLE_CREATE TABLE_DROP TABLE_LISTCONFIGSTATUSWAIT RECONFIGURE REBALANCESYNC INDEX_CREATE INDEX_DROP INDEX_LIST INDEX_STATUS INDEX_WAIT INDEX_RENAMEFUNCALLBRANCHORANDFOR_EACHFUNCASCDESCINFOMATCHUPCASEDOWNCASESAMPLEDEFAULTJSONTO_JSON_STRINGISO8601 TO_ISO8601 EPOCH_TIME TO_EPOCH_TIMENOW IN_TIMEZONEDURINGDATE TIME_OF_DAYTIMEZONEYEARMONTHDAY DAY_OF_WEEK DAY_OF_YEARHOURSMINUTESSECONDSTIMEMONDAYTUESDAY WEDNESDAYTHURSDAYFRIDAYSATURDAYSUNDAYJANUARYFEBRUARYMARCHAPRILMAYJUNEJULYAUGUST SEPTEMBEROCTOBERNOVEMBERDECEMBERLITERALGROUPSUMAVGMINMAXSPLITUNGROUPRANDOMCHANGESARGSBINARYGEOJSON TO_GEOJSONPOINTLINEPOLYGONDISTANCE INTERSECTSINCLUDESCIRCLEGET_INTERSECTINGFILL GET_NEAREST POLYGON_SUBMINVALMAXVAL$fWireValueTermType $fEqTermType$fShowTermTypeProtocolPROTOBUFVersionV0_1V0_2V0_3V0_4$fWireValueProtocol$fWireValueVersion $fEqVersion $fShowVersion $fEqProtocol$fShowProtocolIndex PrimaryKeyTable tableDatabase tableNametablePrimaryKeyDatabase databaseNameKey$fIsStringIndex$fIsStringTable $fShowTable$fIsStringDatabase$fShowDatabase $fEqDatabase $fOrdDatabase $fEqTable $fOrdTableExprReQLapplyjsToDatumtoDatumLonLat longitudelatitude GeoPolygongeoPolygonLinesGeoLine geoLinePointsObjectArray FromDatum parseDatumDatumNullBoolStringNumberTimePointLinePolygonBinary fromDatum.=.:.:?encodedecode eitherDecode resultToMayberesultToEitherobject $fOrdDatum $fToJSONDatum$fFromJSONDatum$fToDatumFloat$fToDatumDouble $fToDatumBool $fToDatumText$fToDatumText0$fToDatumInteger $fToDatum[] $fToDatumChar$fToDatumWord64$fToDatumWord32$fToDatumWord16$fToDatumWord8 $fToDatumWord$fToDatumInt64$fToDatumInt32$fToDatumInt16 $fToDatumInt8 $fToDatumInt$fToDatumValue$fToDatumLonLat$fToDatumRatio $fToDatumSet$fToDatumMaybe$fToDatumByteString$fToDatumByteString0$fToDatumEither$fToDatumUTCTime$fToDatumZonedTime $fToDatumMap $fToDatumMap0$fToDatumHashMap$fToDatumHashMap0$fToDatum(,,,,)$fToDatum(,,,) $fToDatum(,,) $fToDatum(,) $fToDatum()$fToDatumDatum$fToDatumVector $fToDatum[]0 $fShowDatum $fShowLonLat $fEqDatum$fFromDatumRatio$fFromDatumText$fFromDatumText0$fFromDatumInteger$fFromDatumChar$fFromDatumValue$fFromDatumBool$fFromDatumDouble$fFromDatumWord64$fFromDatumWord32$fFromDatumWord16$fFromDatumWord8$fFromDatumWord$fFromDatumInt64$fFromDatumInt32$fFromDatumInt16$fFromDatumInt8$fFromDatumInt $fFromDatum[]$fFromDatumFloat$fFromDatumLonLat$fFromDatumGeoPolygon$fFromDatumGeoLine$fFromDatumVector$fFromDatumUTCTime$fFromDatumZonedTime$fFromDatumSet$fFromDatumMaybe$fFromDatumMap$fFromDatumMap0$fFromDatumHashMap$fFromDatumHashMap0$fFromDatumByteString$fFromDatumByteString0$fFromDatumEither$fFromDatum(,,,,)$fFromDatum(,,,)$fFromDatum(,,)$fFromDatum(,) $fFromDatum()$fFromDatumDatum$fFromDatum[]0 $fEqLonLat $fOrdLonLat$fEqGeoPolygon$fOrdGeoPolygon $fEqGeoLine $fOrdGeoLineBoundOpenClosed DefaultBoundMinValMaxValgetBound WireBacktrace backtraceJSONFrameFramePosFrameOpt Backtrace WireQuery queryJSONexprexprList TermAttributeDynamicStaticOptArg Attribute:=::= NoAttributeArrarr baseArrayOptArgsex QuerySettings queryTokenqueryDefaultDatabase queryVarIndex queryReadModeTermNotetermTypetermArgs termOptArgs termDatumtermNotetermTermrunReQLwithQuerySettingsnewVarIdcons?:=op'op datumTermstrnum buildQuery reqlToDatumconvertBacktraceminvalmaxval closedOrOpenemptynote$fFloatingReQL$fFractionalReQL $fExpr(,,,,) $fExpr(,,,) $fExpr(,,) $fExpr(,) $fNumBound$fFunctorBound $fExprBound $fExprTerm$fExprZonedTime $fExprUTCTime$fFromDatumFrame $fShowFrame $fShowReQL $fExprHashMap $fExprArgList$fExpr[]$fExprDatabase $fExprTable $fExpr(->) $fExpr(->)0 $fExpr(->)1 $fExpr(->)2 $fExpr(->)3 $fExprLonLat $fExprRatio $fExprWord64 $fExprWord32 $fExprWord16 $fExprWord8 $fExprWord$fExprByteString$fExprByteString0 $fExprText $fExprText0 $fExprInt64 $fExprInt32 $fExprInt16 $fExprInt8 $fExprFloat$fExpr() $fExprDouble $fExprDatum $fExprBool $fExprInteger $fExprInt $fExprValue $fExprVector $fExprSet $fExprMaybe $fExprMap $fExprMap0$fExprHashMap0$fExprHashMap1 $fExprEither $fExprChar $fExprReQL$fIsStringReQL $fNumReQL$fShowTermAttribute$fExprAttribute $fArrArgList $fArr(,,,) $fArr(,,)$fArr(,)$fArr[]$fArr()$fMonoidArgList $fShowTerm $fOptArgs(->) $fOptArgsReQL$fDefaultQuerySettings$fEqTerm$fEqTermAttribute$fShowWireQueryUnitMeter KilometerMile NauticalMileFootfillgeoJSON toGeoJSONgetIntersecting getNearestincludes intersectslinepointpolygon polygonSubcircledistance maxResultsmaxDistunit numVertices $fExprUnittermToMapReduceConflictResolutionReplaceUpdatePaginationStrategyLinkNextPaginationFunction HttpMethodPOSTPUTPATCHHEADHttpResultFormat FormatAuto FormatJSON FormatJSONP FormatBinary HttpOptions httpTimeouthttpReattempts httpRedirects httpVerifyhttpResultFormat httpMethodhttpAuth httpParams httpHeaderhttpDatahttpPage httpPageLimit tableCreateinsertupdatereplacedeleteforEachtable tableDrop tableList+-*/mod||&&==/=><>=<=notcountunionmapfilterbetweenappend concatMap innerJoin outerJoineqJoinskiplimitslicenthreduce0reducedistinctziporderByascdescgroup mapReducesumavgminargminmaxfloorceilroundargmax!!?pluckwithoutcontainsmergeliteralremovebrancherrordbdbCreatedbDropdbList indexCreate indexStatus indexWait indexRenamesync indexList indexDropgetAllgetcoerceToasArrayasStringasNumberasObjectasBool withFields indexesOfisEmptysampleprepend difference setInsertsetUnionsetIntersection setDifference hasFieldsinsertAtspliceAtdeleteAtchangeAtkeysvaluesmatchhandletypeOfinfojson#upcasedowncasesplitsplitOnsplitMaxrandomrandomTo randomFromTohttpargschanges returnChanges includeStatesincludeInitial nonAtomicconflictuuiduuid5range rangeFromTorangeAllwaittoJSONzipWithzipWithN reconfigure rebalanceconfigstatus$fExprConflictResolution$fDefaultHttpOptions$fExprPaginationStrategy$fExprHttpMethod$fExprHttpResultFormat$fShowHttpMethod ErrorCodeErrorBrokenClient ErrorBadQuery ErrorRuntimeErrorUnexpectedResponseMoreResponse ResponseErrorResponseSingle ResponseBatchRethinkDBError errorCode errorTerm errorMessageerrorBacktraceRethinkDBConnectionErrorCursor cursorMBox cursorBuffer cursorMapRethinkDBHandle rdbSocket rdbWriteLockrdbToken rdbDatabaserdbWait rdbThreadconnect runQLQueryuseclose nextResponse makeCursornext nextBatchcollectcollect' noReplyWaiteach serverInfo$fExceptionRethinkDBReadError$fShowResponse$fShowErrorCode$fShowRethinkDBError$fExceptionRethinkDBError#$fExceptionRethinkDBConnectionError$fShowRethinkDBHandle$fFunctorCursor$fShowRethinkDBConnectionError$fShowRethinkDBReadErrorChangeoldValnewVal WriteResponsewriteResponseInsertedwriteResponseDeletedwriteResponseReplacedwriteResponseUnchangedwriteResponseSkippedwriteResponseErrorswriteResponseFirstErrorwriteResponseGeneratedKeyswriteResponseChanges convertResult DurabilityHardSoftRunFlag UseOutdatedReadModeNoReplyProfile ArrayLimit durabilityrunOptsrunrun'$fShowWriteResponse$fFromDatumWriteResponse$fFromDatumChange $fShowChange$fResultWriteResponse $fResultDatum$fResult(,,,,) $fResult(,,,) $fResult(,,) $fResult(,)$fResultLonLat $fResultRatio $fResultMap $fResultMap0$fResultHashMap$fResultHashMap0$fResultVector $fResultSet$fResultUTCTime$fResultZonedTime $fResultText $fResultText0$fResultByteString$fResultByteString0$fResultInteger$fResultWord64$fResultWord32$fResultWord16 $fResultWord8 $fResultWord $fResultInt64 $fResultInt32 $fResultInt16 $fResultInt8 $fResultFloat $fResultChar $fResultValue $fResult() $fResultBool$fResultDouble $fResultInt $fResultMaybe$fResultEither $fResult[]$fResultCursor$fResultResponse$fExprDurabilitynowtime epochTimeiso8601 inTimezoneduringtimezonedate timeOfDayyearmonthday dayOfWeek dayOfYearhoursminutesseconds toIso8601 toEpochTimetry'doctestConnectsortedReduce BuiltInReduceMapFun ConcatMapFunMap BuiltInMapChainNoneMapReduceChain MapReduceSingletonArrayAddBaseMRF _mrfMapFun _mrfReduceFun_mrfBase _mrfFinallysameVarnotConstwraptoFun1toFun2 applyChainapplyMRF applyMapsapplyMap applyMapFun applyReduce chainToMRF thenFinallythenMRF composeMaps composeMapFun thenReduce toMapReduce singletonmrChainmapMRF reduceMRFbaseAttrToOptArg noRecurserewrite1rewritexextract errorExpected showLonLat showDouble toJSONDatum pointToPair parseTimeZoneArgListWireTermtermJSON shortLinesvarNamemapTermAttributebaseAttributesargListtoIntstoIntvarsOfvarOf alphaRenameupdateChildren buildTerm complexDatumencodeTextJSONbuildAttributesboundOpRethinkDBReadError WireResponse_responseDatum _moreFeed _moreHandle _moreTokenTokennewToken getAddrFamily connectTorecvAllsGetNullTerminatedString magicNumber withSocketconvertResponseisNoReplyQueryaddMBox sendQLQuery readResponsesreadSingleResponseisLastResponse closeTokencursorFetchBatchMajoritySingleOutdated renderOptionunsafeFromDatumnextFail assertEndbaseGHC.Base++ghc-primGHC.PrimseqGHC.List System.IOprint Data.Tuplefstsnd otherwise$GHC.Real fromIntegral realToFracGHC.EnumBoundedminBoundmaxBoundEnumenumFrom enumFromThenenumFromThenTo enumFromTofromEnumtoEnumsuccpred GHC.ClassesEq GHC.FloatFloatingpiexplogsqrt**logBasesincostanasinacosatansinhcoshtanhasinhacoshatanh Fractional fromRationalrecipIntegral toIntegerquotremdivquotRemdivModMonadfail>>=>>returnFunctorfmap<$GHC.NumNumnegate fromIntegerabssignumOrdcompareGHC.ReadReadreadList readsPrecReal toRational RealFloat floatRadix floatDigits floatRange decodeFloat encodeFloatexponent significand scaleFloatisNaN isInfiniteisDenormalizedisNegativeZeroisIEEEatan2RealFracproperFractiontruncateceilingGHC.ShowShow showsPrecshowshowList Applicative<*>pure*><* Data.FoldableFoldablefoldrlengthfoldMapnullfoldlfoldl1productfoldr1maximumminimumelemData.Traversable TraversabletraversemapM sequenceAsequenceMonoidmemptymappendmconcat GHC.TypesTrueFalseCharDoubleFloatInt integer-gmpGHC.Integer.TypeIntegerMaybeNothingJustOrderingRationalIOWord Data.EitherEitherLeftRight Data.Functor<$>#text-1.2.2.1-9Yh8rJoh8fO2JMLWffT3QsData.Text.InternalText Text.ReadreadreadIOreadLn appendFile writeFilereadFileinteract getContentsgetLinegetCharputStrLnputStrputCharreadsGHC.IO.ExceptionioErrornotElemallanyorandconcat sequence_mapM_GHC.IOFilePath userErrorIOErroreither Data.OldListunwordswordsunlineslineslex readParenText.ParserCombinators.ReadPReadSlcmgcd^^^oddeven showParen showStringshowCharshowsShowSunzip3unzipzipWith3zip3!!lookupreversebreakspansplitAtdroptake dropWhile takeWhilecycle replicaterepeatiteratescanr1scanrscanl1scanlinitlasttailhead Data.MaybemapMaybe catMaybes listToMaybe maybeToList fromMaybefromJust isNothingisJustmaybeuncurrycurrysubtractasTypeOfuntil$!flip.constid=<<GHC.Err undefinederrorWithoutStackTrace