{"action":"created","issue":{"url":"https://api.github.com/repos/rethinkdb/horizon-docs/issues/120","repository_url":"https://api.github.com/repos/rethinkdb/horizon-docs","labels_url":"https://api.github.com/repos/rethinkdb/horizon-docs/issues/120/labels{/name}","comments_url":"https://api.github.com/repos/rethinkdb/horizon-docs/issues/120/comments","events_url":"https://api.github.com/repos/rethinkdb/horizon-docs/issues/120/events","html_url":"https://github.com/rethinkdb/horizon-docs/issues/120","id":176141135,"number":120,"title":"Embedding docs incorrectly uses `_reql_conn` as a property of the server module","user":{"login":"Tryneus","id":552910,"avatar_url":"https://avatars.githubusercontent.com/u/552910?v=3","gravatar_id":"","url":"https://api.github.com/users/Tryneus","html_url":"https://github.com/Tryneus","followers_url":"https://api.github.com/users/Tryneus/followers","following_url":"https://api.github.com/users/Tryneus/following{/other_user}","gists_url":"https://api.github.com/users/Tryneus/gists{/gist_id}","starred_url":"https://api.github.com/users/Tryneus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Tryneus/subscriptions","organizations_url":"https://api.github.com/users/Tryneus/orgs","repos_url":"https://api.github.com/users/Tryneus/repos","events_url":"https://api.github.com/users/Tryneus/events{/privacy}","received_events_url":"https://api.github.com/users/Tryneus/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-09-10T00:15:42Z","updated_at":"2016-09-13T06:05:02Z","closed_at":null,"body":"in `docs/embed`, the last section `Accessing the Rethinkdb 'r' object` has the code:\r\n\r\n```js\r\nconst horizon = require('@horizon/server');\r\nconst conn = horizon._reql_conn.connection();\r\n```\r\n\r\nThis is wrong, `_reql_conn` is a property of a `Server` instance, not of the `@horizon/server` module.  In order to get the connection, you need to instantiate a `Server` and pass it the information for `r.connect`, at which point it may become available.\r\n\r\nSee related issue at rethinkdb/horizon#807"},"comment":{"url":"https://api.github.com/repos/rethinkdb/horizon-docs/issues/comments/246583789","html_url":"https://github.com/rethinkdb/horizon-docs/issues/120#issuecomment-246583789","issue_url":"https://api.github.com/repos/rethinkdb/horizon-docs/issues/120","id":246583789,"user":{"login":"Tryneus","id":552910,"avatar_url":"https://avatars.githubusercontent.com/u/552910?v=3","gravatar_id":"","url":"https://api.github.com/users/Tryneus","html_url":"https://github.com/Tryneus","followers_url":"https://api.github.com/users/Tryneus/followers","following_url":"https://api.github.com/users/Tryneus/following{/other_user}","gists_url":"https://api.github.com/users/Tryneus/gists{/gist_id}","starred_url":"https://api.github.com/users/Tryneus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Tryneus/subscriptions","organizations_url":"https://api.github.com/users/Tryneus/orgs","repos_url":"https://api.github.com/users/Tryneus/repos","events_url":"https://api.github.com/users/Tryneus/events{/privacy}","received_events_url":"https://api.github.com/users/Tryneus/received_events","type":"User","site_admin":false},"created_at":"2016-09-13T06:05:02Z","updated_at":"2016-09-13T06:05:02Z","body":"@chipotle - not entirely - the connection will not be ready immediately, so the `ready()` function returns a promise:\r\n\r\n```js\r\n...\r\nconst horizonServer = horizon(httpServer, options);\r\nconst r = horizon.r;\r\n\r\nhorizonServer._reql_conn.ready().then((reql_conn) => {\r\n  r.expr('foo').run(reql_conn.connection());\r\n});\r\n```\r\n\r\nAlso, the header for the section indicates it was to show how the same `r` object can be used, I though the ReQL connection was just an aside.\r\n\r\nAnyway, a lot of this stuff is changing for the plugins feature, though, so I wouldn't put too much work into this section yet."}}
{"actor":{"display_login":"Tryneus"}}