Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Flesh out README

  • Loading branch information...
commit 8793c0234815e2b384fabafb876284157a6a1bbd 1 parent db0ffcb
@edsrzf authored
Showing with 51 additions and 2 deletions.
  1. +51 −2 README.md
View
53 README.md
@@ -1,3 +1,52 @@
-Mongogo is a MongoDB driver for Go.
+Mongogo
+=======
-It's not well tested, but the basics seem to work well enough.
+Mongogo is a MongoDB driver for the Go programming language
+(http://golang.org/).
+
+This project is still in development. It's not well tested, but the basics seem to
+work well enough.
+
+Dependencies
+------------
+
+Mongogo has one dependency outside of the core libraries:
+edsrzf/go-bson
+
+You can install it with goinstall by running
+ goinstall github.com/edsrzf/go-bson
+
+Usage
+-----
+
+Create a connection:
+
+ conn := mongo.Dial("127.0.0.1:27017")
+
+Get a database:
+
+ db := conn.Database("blog")
+
+Get a collection:
+
+ col := db.Collection("posts")
+
+Insert a document into the collection:
+
+ doc := map[string]interface{}{"title": "Hello", "body": "World!"}
+ col.Insert(doc)
+
+Query the database:
+
+ q := mongo.Query{"title": "Hello"}
+ cursor := col.Query(q, 0, 0)
+ defer cursor.Close()
+
+See the documentation in the source for more information.
+
+Contributing
+------------
+
+Simply use GitHub as usual to create a fork, make your changes, and create a pull
+request. Code is expected to be formatted with gofmt and to adhere to the usual Go
+conventions -- that is, the conventions used by Go's core libraries.
Please sign in to comment.
Something went wrong with that request. Please try again.