<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>kakts</author_name>
  <author_url>https://blog.hatena.ne.jp/kakts/</author_url>
  <blog_title>kakts-log</blog_title>
  <blog_url>https://kakts.dev/</blog_url>
  <categories>
    <anon>mongoDB</anon>
    <anon>Go</anon>
  </categories>
  <description>概要 Go revelというwebフレームワークで個人のwebアプリを作っている最中にハマった箇所のメモ。 mgoというGoのmongoドライバを使って、mongoDBとのコネクションを保持させ、CRUD処理を1ファイルにまとめて 他のcontroller層から呼び出して使いたかったので その方法をまとめました。 今回、mongoに関しては、特にレプリカセットを組まずに、単一のmongodに対してアクセスさせます。 アプリのファイル構成 revelを使ったアプリのファイル構成は以下のとおりです。 ファイル構成はrevel new app コマンドで自動生成されたままで、特に変えていないです。 …</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fkakts.dev%2Fentry%2F2017%2F09%2F19%2F000316&quot; title=&quot;Go revelでのmongoDBとのコネクション、CRUD処理についてのメモ - kakts-log&quot; class=&quot;embed-card embed-blogcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;</html>
  <image_url></image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2017-09-19 00:03:16</published>
  <title>Go revelでのmongoDBとのコネクション、CRUD処理についてのメモ</title>
  <type>rich</type>
  <url>https://kakts.dev/entry/2017/09/19/000316</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
