{"id":18519333,"url":"https://github.com/eyedouble/erlang_rethinkdb","last_synced_at":"2025-05-14T16:17:51.646Z","repository":{"id":143749859,"uuid":"104382624","full_name":"eyedouble/erlang_rethinkdb","owner":"eyedouble","description":"The Erlang Rethink Db Driver","archived":false,"fork":false,"pushed_at":"2017-11-24T08:41:16.000Z","size":33,"stargazers_count":1,"open_issues_count":1,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-05-14T16:17:42.230Z","etag":null,"topics":["erlang","erlang-library","erlang-otp","rethink","rethinkdb-adapter","rethinkdb-driver"],"latest_commit_sha":null,"homepage":"https://eyedouble.nl","language":"Erlang","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/eyedouble.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2017-09-21T18:14:29.000Z","updated_at":"2021-12-17T11:29:50.000Z","dependencies_parsed_at":null,"dependency_job_id":"6d587915-4a65-4613-991a-b8091d1c8cad","html_url":"https://github.com/eyedouble/erlang_rethinkdb","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eyedouble%2Ferlang_rethinkdb","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eyedouble%2Ferlang_rethinkdb/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eyedouble%2Ferlang_rethinkdb/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eyedouble%2Ferlang_rethinkdb/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/eyedouble","download_url":"https://codeload.github.com/eyedouble/erlang_rethinkdb/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254179904,"owners_count":22027884,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["erlang","erlang-library","erlang-otp","rethink","rethinkdb-adapter","rethinkdb-driver"],"created_at":"2024-11-06T17:16:06.598Z","updated_at":"2025-05-14T16:17:51.640Z","avatar_url":"https://github.com/eyedouble.png","language":"Erlang","funding_links":[],"categories":[],"sub_categories":[],"readme":"The Erlang RethinkDb Driver\n=====\n\n**The Erlang RethinkDb Driver**\nA fork of Relang.\n\n## Contribute\nI am new to the Erlang world and don't have the knowledge (yet) to fix this package properly, but hey I made a start.\n\nI call upon all of you let's give Erlang the packages it deserves. \nStart today by improving this one! Let's bombard ![hex.pm](https://hex.pm) with Erlang. FFS. \n\n## What should happen\n* Vast refactor\n* Proper documentation\n* YAGNI appoach towards the ReQl implementation.\n* Use best practises\n\n## Change Feed\nI managed to get Change Feeds working, the API is far from beautiful tough.\n\n\n---------------------------------------------------\n\n\n\n# Documentation (from orginal project)\nPlease note this documentation contains errors. Further it has some grammar and vocabulary issues.  \n\n\n```Erlang\n\n%% Creation conection\nConnection = relang:connect(\"127.0.0.1\")\n\nrelang:r(Connection, [{db_create, \"db1}])\nrelang:r(Connection, [{db_list}])\nrelang:r(Connection, [{db, [\"test\"]}, {table_list}])\nrelang:r(Connection, [{db, [\"test\"]}, {table_create, [\"t1\"]}])\nrelang:r(Connection, [{db, [\"test\"]}, {table, [\"t4\"]}, {insert, [\"{\\\"name\\\":\\\"vinh\\\",\\\"age\\\":27}\"]}]).\n```\n\nIdeally instead of chaining function like in Python, we put the query into\na list of tuples. I want and I like chaining style but I don't know how\nto do that in Erlang.\n\nEach of tuples of query includes one to 3 element:\n\n```\n{operation, argument, options}\n```\n\noperation is the name that try to match official Python driver. Such as \n\n```\n{table_create, argument, options}\n{insert, argument, options}\n```\n\nArgument list element can be anything, from tuple to `function` when the\nanonymous function is passed.\n\nArgument is a list, if you pass a tuple, the driver attempt to convert\nit to a list. How many items of the list is depends on how many item the\noperation accept.\n\n\nSome special function has different syntax such as changefeed and filter\nbecause they are a bit different.\n\n## Cursor\n\nsome queries don't return all data. But only a partial of data. we can\niterator over the result set use a concept call `cursor`\n\n```Erlang\n{ok, {cursor, Cursor}, _} = relang:r(Connection, [[{db, [\"test\"]}, {table, [\"t4\"]}),\n```\n\n## next\n\nnext can works with a callback\n\n```Erlang\nrelang:next(cursor, fun(V) -\u003e io:format(\"Value ~p\", [V] end))\n```\nor a process\n\n```Erlang\nPid = spawn(...)\nrelang:next(cursor, Pid)\n```\n\n## Changefeeds\n\n```\nrelang:r(Connection, [[{db, [\"test\"]}, {table, [\"t4\"]}, {change, fun(Item) -\u003e io:format(Item) end}).\n```\n\n  * Limit: Only a `change` command in the list\n\n## Filter and row\n\nOn the surface, filter looks like they are code that run on driver side,\nbut actually they are serialized and pass to the server for evaluate.\n\nDepend on driver, the syntax of using `row` with `filter` is different.\nHere is how we do it in Erlang:\n\nWith exactly match.\n```\nl(relang). l(relang_ast). l(log).\nrelang:r(relang:connect(\"127.0.0.1\"),\n  [ {db, [\u003c\u003c\"test\"\u003e\u003e]},\n    {table, [\u003c\u003c\"tv_shows\"\u003e\u003e]},\n    {filter, [\n      [{\u003c\u003c\"age\"\u003e\u003e, 30},\n      {\u003c\u003c\"name\"\u003e\u003e, \u003c\u003c\"kurei\"\u003e\u003e},\n      {\u003c\u003c\"show\"\u003e\u003e, 1}]\n    ]}\n  ]\n).\n\n```\n\nIt's not powerful enough so we come up With functional style\n\n```Erlang\nrelang:r(relang:connect(),\n[{db, [\u003c\u003c\"test\"\u003e\u003e]}, {table, [\u003c\u003c\"tv_shows\"\u003e\u003e]}, \n                  {filter, fun(X) -\u003e\n                               [\n                                  {'and', [\n                                           {gt, [{field, [X, \u003c\u003c\"age\"\u003e\u003e]}, 22]},\n                                           {lt, [{field, [X, \u003c\u003c\"age\"\u003e\u003e]}, 25]},\n                                           {match, [{field, [X, \u003c\u003c\"name\"\u003e\u003e]},  \u003c\u003c\"^k\"\u003e\u003e]}\n                                          ]}\n                                 ]\n                           end}]\n).\n\nrelang:r(C, [{db, [\u003c\u003c\"test\"\u003e\u003e]}, {table,\n[\u003c\u003c\"tv_shows\"\u003e\u003e]}, {filter, fun(X) -\u003e\n  [\n    {'and', [\n      {gt, [{field, [X, \u003c\u003c\"age\"\u003e\u003e]}, 22]},\n      {lt, [{field, [X, \u003c\u003c\"age\"\u003e\u003e]}, 25]}\n    ]}\n  ]\nend}]).\n\n# find user 22 -\u003e 25 of age, name starts with `k`, and opt-in to `show`\nrelang:r(C, [{db, [\u003c\u003c\"test\"\u003e\u003e]}, {table,\n[\u003c\u003c\"tv_shows\"\u003e\u003e]}, {filter, fun(X) -\u003e\n  [\n    {'and', [\n      {gt, [{field, [X, \u003c\u003c\"age\"\u003e\u003e]}, 22]},\n      {lt, [{field, [X, \u003c\u003c\"age\"\u003e\u003e]}, 25]},\n      {match, [{field, [X, \u003c\u003c\"name\"\u003e\u003e]},  \u003c\u003c\"^k\"\u003e\u003e]},\n      {field, \u003c\u003c\"show\"\u003e\u003e\n    ]}\n  ]\nend}]).\n\nl(relang). l(relang_ast). l(log).\nrelang:r(relang:connect(\"127.0.0.1\"), [{db, [\u003c\u003c\"test\"\u003e\u003e]}, {table,\n[\u003c\u003c\"tv_shows\"\u003e\u003e]}, {filter, fun(X) -\u003e\n  [\n    {field, [X, \u003c\u003c\"show\"\u003e\u003e]}\n  ]\nend}]).\n\n```\n\n## Expr(WIP)\n\n```\nrelang:r(Connection, [{expr(2)}]).\n```\n\n# API\n\n```\nrelang:r(relang:connect(\"127.0.0.1\"), [{now}]).\n```\n\n## Connect\n\n```Erlang\nC1 = relang:connect(\"127.0.0.1\")\n```\n\n## Manipulating tables\n\n#### table_create\n\n```Erlang\nrelang:r(relang:connect(), [{table_create, geo}]).\n% or with db\nrelang:r(relang:connect(), [{db, test}, {table_create, geo}]).\n```\n\n#### table_drop\n\n```Erlang\nrelang:r(relang:connect(), [{table_drop, geo}]).\n% or with db\nrelang:r(relang:connect(), [{db, test}, {table_drop, geo}]).\n```\n\n## Selecting data\n\n### db\n### table\n\n```Erlang\nrelang:r(C1, [{db, [\u003c\u003c\"test\"\u003e\u003e]},  {table, \u003c\u003c\"tv_shows\"\u003e\u003e}]).\n```\n### get\n\n```Erlang\nrelang:r(C1, [{db, [\u003c\u003c\"test\"\u003e\u003e]},  {table, \u003c\u003c\"tv_shows\"\u003e\u003e}, {get, \u003c\u003c\"primarykey\"\u003e\u003e]).\n```\n\n### Nested field\n\nA ReQL document is a JSON object: a set of key-value pairs, in which\neach value might be a single value, a list of values, or another set of\nkey-value pairs. When the value of a field contains more fields, we\ndescribe these as nested fields.\n\nWe access nested field, or indicate it by using a list, to denote a\npath.\n\n\n```Erlang\nrelang:r(C1, \n  [\n    {db, [\u003c\u003c\"test\"\u003e\u003e]},\n    {table, \u003c\u003c\"user\"\u003e\u003e},\n    {get, [\u003c\u003c\"primarykey\"\u003e\u003e, {field: []}]}\n  ]\n  ).\n```\n\n### filter\nReference filter below because they have a different syntax.\n\n## Joins\n\n### Inner joins\n\n```\nrelang:r(relang:connect(),\n  [{db, [\u003c\u003c\"foodb\"\u003e\u003e]},\n    {table, \u003c\u003c\"tv_shows\"\u003e\u003e},\n    {eq_join,\n      [\u003c\u003c\"compound_id\"\u003e\u003e,\n        [{db, [\u003c\u003c\"foodb\"\u003e\u003e]}, {table, \u003c\u003c\"compounds\"\u003e\u003e}]\n      ]\n    }\n  ]\n).\n```\n\n### Equal join\n\nSimple form, join use a column on left table whose value is equal to\nindex on right table. Using primary index by default\n```Erlang\nrelang:r(relang:connect(),\n  [{db, [\u003c\u003c\"foodb\"\u003e\u003e]},\n    {table, \u003c\u003c\"tv_shows\"\u003e\u003e},\n    {eq_join,\n      [\u003c\u003c\"compound_id\"\u003e\u003e,\n        [{db, [\u003c\u003c\"foodb\"\u003e\u003e]}, {table, \u003c\u003c\"compounds\"\u003e\u003e}]\n      ]\n    }\n  ]\n).\n```\n\nOr using a secondary index\n\n```\nrelang:r(relang:connect(),\n  [{db, [\u003c\u003c\"foodb\"\u003e\u003e]},\n    {table, \u003c\u003c\"tv_shows\"\u003e\u003e},\n    {eq_join,\n      [\u003c\u003c\"compound_id\"\u003e\u003e,\n        [{db, [\u003c\u003c\"foodb\"\u003e\u003e]}, {table, \u003c\u003c\"compounds\"\u003e\u003e}]\n      ],\n      [{\u003c\u003c\"index\"\u003e\u003e, \u003c\u003c\"different_index\"\u003e\u003e}]\n    }\n  ]\n).\n```\n\n@TODO\nOr using function instead of string\n\n```Erlang\nl(relang). l(relang_ast). l(log).\nrelang:r(relang:connect(),\n  [{db, [\u003c\u003c\"foodb\"\u003e\u003e]},\n    {table, \u003c\u003c\"tv_shows\"\u003e\u003e},\n    {eq_join,\n      [\n        fun (X) -\u003e\n            [\n              {field, {field, [X, \u003c\u003c\"Parent\"\u003e\u003e]}, \u003c\u003c\"Sub\"\u003e\u003e}\n            ]\n        end,\n        [{table, \u003c\u003c\"compounds\"\u003e\u003e}]\n      ]\n      ,\n      [{\u003c\u003c\"index\"\u003e\u003e, \u003c\u003c\"different_index\"\u003e\u003e}]\n    }\n  ]\n).\n```\n\nMore complex expression\n\n```\nl(relang). l(relang_ast). l(log).\nrelang:r(relang:connect(),\n  [{db, [\u003c\u003c\"foodb\"\u003e\u003e]},\n    {table, \u003c\u003c\"tv_shows\"\u003e\u003e},\n    {eq_join,\n      [\n        fun (X) -\u003e\n            [\n              {field, {field, [X, \u003c\u003c\"Parent\"\u003e\u003e]}, \u003c\u003c\"Sub\"\u003e\u003e},\n               {nth, 20}\n            ]\n        end,\n        [{table, \u003c\u003c\"compounds\"\u003e\u003e}]\n      ]\n      ,\n      [{\u003c\u003c\"index\"\u003e\u003e, \u003c\u003c\"different_index\"\u003e\u003e}]\n    }\n  ]\n).\n```\n\n### zip\n\nUsing with `eq_join`\n\n```Erlang\nl(relang). l(relang_ast). l(log).\nrelang:r(relang:connect(),\n  [{db, [\u003c\u003c\"foodb\"\u003e\u003e]},\n    {table, \u003c\u003c\"compounds_foods\"\u003e\u003e},\n    {eq_join,\n      [\u003c\u003c\"compound_id\"\u003e\u003e,\n        [{db, [\u003c\u003c\"foodb\"\u003e\u003e]}, {table, \u003c\u003c\"compounds\"\u003e\u003e}]\n      ],\n      [{\u003c\u003c\"index\"\u003e\u003e, \u003c\u003c\"second_index\"\u003e\u003e}]\n    },\n    {zip}\n  ]\n).\n```\n\nOr without index:\n\n```Erlang\nl(relang). l(relang_ast). l(log).\nrelang:r(relang:connect(),\n  [{db, [\u003c\u003c\"foodb\"\u003e\u003e]},\n    {table, \u003c\u003c\"compounds_foods\"\u003e\u003e},\n    {eq_join,\n      [\u003c\u003c\"compound_id\"\u003e\u003e,\n        [{db, [\u003c\u003c\"foodb\"\u003e\u003e]}, {table, \u003c\u003c\"compounds\"\u003e\u003e}]\n      ]\n    },\n    {zip}\n  ]\n).\n```\n\n## Transformation\n\n### nth\n\n```\nrelang:r(relang:connect(),\n  [\n    {table, \u003c\u003c\"tv_shows\"\u003e\u003e},\n     {nth, 120}\n  ]\n).\n```\n\n## Writing data\n\n### Insert\n\n```Erlang\nC1 = relang:connect(\"127.0.0.1\")\nrelang:r(C1, [{db, [\u003c\u003c\"test\"\u003e\u003e]},  {table, \u003c\u003c\"tv_shows\"\u003e\u003e}, {insert, [[{\u003c\u003c\"name\"\u003e\u003e, \u003c\u003c\"kurei\"\u003e\u003e}, {\u003c\u003c\"age\"\u003e\u003e, \u003c\u003c28\u003e\u003e}]]}])\n```\n\nWith nested field,\n\n```Erlang\n\nC1 = relang:connect(\"127.0.0.1\")\n```\n\n### Update\n\n```Erlang\nrelang:r(C1, [{db, [\u003c\u003c\"test\"\u003e\u003e]},  {table, \u003c\u003c\"tv_shows\"\u003e\u003e}, {get, \u003c\u003c\"6b443331-d7c9-4304-867d-251db183446f\"\u003e\u003e}, {update, [[{\u003c\u003c\"name\"\u003e\u003e, \u003c\u003c\"kurei kain\"\u003e\u003e}, {\u003c\u003c\"age\"\u003e\u003e, \u003c\u003c29\u003e\u003e}]]}])\n\n% Or update with option\nrelang:r(C1,\n  [{db, [\u003c\u003c\"test\"\u003e\u003e]},\n  {table, \u003c\u003c\"tv_shows\"\u003e\u003e},\n  {get, \u003c\u003c\"6b443331-d7c9-4304-867d-251db183446f\"\u003e\u003e},\n  {update,\n    [[{\u003c\u003c\"name\"\u003e\u003e, \u003c\u003c\"kurei kain\"\u003e\u003e},\n    {\u003c\u003c\"age\"\u003e\u003e, \u003c\u003c29\u003e\u003e}]],\n    [{\u003c\u003c\"durability\"\u003e\u003e, soft}, {return_changes, false}]\n  }\n  ])\n\n% Or update nested field\nrelang:r(relang:connect(),\n  [\n    {table, users},\n    {get, 10001},\n    {update, [\n              [\n               {contact, [{phone, [{cell, \u003c\u003c\"408-555-4242\"\u003e\u003e}]}]}\n              ]\n             ]}\n  ]\n).\n\n% Or update with function \nrelang:r(relang:connect(),\n  [\n    {table, posts},\n    {update,\n      fun(Post) -\u003e\n        [{\n          views,\n            relang:r([\n                {field, [Post, views]},\n                {add, 100},\n                {default, 20}\n              ])\n        }]\n      end\n    }\n  ]).\n```\n\n## Aggregation\n\n### Count\n\n```Erlang\nrelang:query(C, [ {db, [\u003c\u003c\"test\"\u003e\u003e]}, {table, [\u003c\u003c\"tv_shows\"\u003e\u003e]}, {count}]).\n```\n\n## Document manipulation\n\n### get_field\n\n```Erlang\nrelang:r(C1,\n  [\n    {db, [\u003c\u003c\"test\"\u003e\u003e]},\n    {table, \u003c\u003c\"wall_posts\"\u003e\u003e},\n    {get, \u003c\u003c\"primarykey\"\u003e\u003e},\n    {get_field, \u003c\u003c\"field\"\u003e\u003e},\n    {get_field, \u003c\u003c\"sub_field\"\u003e\u003e}\n  ]).\n```\n\nOr\n\n```Erlang\nrelang:r(C1,\n  [\n    {db, [\u003c\u003c\"test\"\u003e\u003e]},\n    {table, \u003c\u003c\"wall_posts\"\u003e\u003e},\n    {get_field, \u003c\u003c\"id\"\u003e\u003e}\n  ]).\n```\n\n### keys\n\n```Erlang\nrelang:r(relang:connect(),\n  [\n    {db, [\u003c\u003c\"test\"\u003e\u003e]},\n    {table, \u003c\u003c\"dummy\"\u003e\u003e},\n    {get, \u003c\u003c\"7541a1ed-20ae-42f2-b7ea-73fbeb668d07\"\u003e\u003e},\n    {keys}\n  ]).\n%%\n%% Ok {\"t\":1,\"r\":[[\"f\",\"id\"]],\"n\":[]}atom response{ok,[[\u003c\u003c\"f\"\u003e\u003e,\u003c\u003c\"id\"\u003e\u003e]]}\n```\n\n### object\n\n```Erlang\nrelang:r(relang:connect(),  [{object, [\u003c\u003c\"k1\"\u003e\u003e, 1, \u003c\u003c\"k2\"\u003e\u003e, 2]}]).\n```\n\n## Geospatial commands\n\n#### circle\n\n```Erlang\nl(relang). l(relang_ast). l(log).\nrelang:r(relang:connect(), [{circle, [{-122.423246, 37.779388}, 1000]}]).\n```\n\n#### distance\n\n```Erlang\nrelang:r(relang:connect(), \n  [\n    {distance, \n      [\n        relang:r([{point, [-122.423246,37.779388]}]),\n        relang:r([{point, [-117.220406,32.719464]}])\n      ],\n      [{unit, km}]\n    }\n  ]).\n```\n\n#### fill\n\nConvert a Line object into a Polygon object. If the last point does not\nspecify the same coordinates as the first point, polygon will close the\npolygon by connecting them.\n\n*Example:* Create a line object and then convert it to a polygon.\n\n```\nrelang:r(relang:connect(),\n  [\n    {table, geo},\n    {insert, [[\n      {id, 201},\n      {rectangle, relang:r([\n        {line, [\n          [-122.423246,37.779388],\n          [-122.423246,37.329898],\n          [-121.886420,37.329898],\n          [-121.886420,37.779388]\n        ]}\n      ])}\n    ]]}\n  ]\n).\n\n% Try to select it back, for fun :)\nrelang:r(relang:connect(),\n  [\n    {table, geo},\n    {get, 201}\n  ]\n).\n\n% using fill to turn it into plolygon\nl(relang). l(relang_ast). l(log).\nrelang:r(relang:connect(),\n  [\n    {table, geo},\n    {get, 201},\n    {update,\n      fun(Doc) -\u003e\n        [{\n          rectangle,\n            relang:r([\n                {field, [Doc, rectangle]},\n                {fill}\n              ])\n        }]\n      end,\n      [{non_atomic, true}]\n    }\n  ]\n).\n```\n\n#### geojson\n\n```Erlang\nT = [{type,'Point'},\n       {coordinates, [ -122.423246, 37.779388 ]\n       }\n      ].\nrelang:r(relang:connect(), [{geojson, T]).\n```\n\nAnother complex example:\n\n```Erlang\nl(relang). l(relang_ast). l(log).\nT = [{type,'Point'},\n     {coordinates, [ -122.423246, 37.779388 ]\n     }\n    ]\n    .\nQ = [\n     {table, geo},\n     {insert, [[\n      {id, sfo},\n      {name, \u003c\u003c\"San Francisco\"\u003e\u003e},\n      {location, relang:r([{geojson, T}])}\n              ]]}\n    ].\nrelang:r(relang:connect(), Q).\n```\n\n#### to_geojson\n\n#### get_intersecting\n\n#### get_nearest\n\n#### includes\n\n#### intersects\n\n#### line\n\n```Erlang\nrelang:r([\n   {line,\n    [\n     [-122.423246,37.779388],\n     [-121.886420,37.329898]\n    ]\n   }\n  ]).\n```\n\nor using in other expression:\n\n```Erlang\nrelang:r(relang:connect(),   [\n    {table, geo},\n    {insert, [[\n      {id, 101},\n      {route,\n        relang:r([\n          {line, [\n            [-122.423246,37.779388], [-121.886420,37.329898]\n          ]}\n        ])\n      }\n    ]]}\n  ]\n).\n```\n\n### point\n\n```Erlang\nl(relang). l(relang_ast). l(log).\nrelang:r([{point, [-122.423246, 37.779388]}]).\n```\n\n### polygon\n\n```Erlang\nl(relang). l(relang_ast). l(log).\nrelang:r(relang:connect(),  [{polygon,\n        [\n          [-122.423246,37.779388],\n          [-122.423246,37.329898],\n          [-121.886420,37.329898],\n          [-121.886420,37.779388]\n        ]\n       }\n      ]\n).\n```\n\nOr using in other expression\n\n```Erlang\n(relang). l(relang_ast). l(log).\nrelang:r(relang:connect(),     [\n      {table, geo},\n      {insert, [[\n        {id, 101},\n        {rectangle, relang:r([{polygon,\n            [\n              [-122.423246,37.779388],\n              [-122.423246,37.329898],\n              [-121.886420,37.329898],\n              [-121.886420,37.779388]\n            ]\n           }\n          ])\n        }\n      ]]}\n    ]\n).\n```\n\n### polygon_sub\n\n\n# Development\n\nMake sure to use `tcpdump` during development for ReQL inspect\n\n```\ntcpdump -nl -w - -i lo0 -c 500 port 28015|strings\n```\n\nOnce compile, we can get into REPl\n\n```\nerl -pa ebin -pa deps/protobuffs/ebin deps/jsx/ebin\n```\n\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feyedouble%2Ferlang_rethinkdb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Feyedouble%2Ferlang_rethinkdb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feyedouble%2Ferlang_rethinkdb/lists"}