We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent dc01706 commit 49484fcCopy full SHA for 49484fc
storage.go
@@ -33,10 +33,13 @@ func (storage *MongoStorage) accounts() *mgo.Collection {
33
return storage.Database.C("accounts")
34
}
35
36
+// CreateAccount persists an Account model into Mongo as it's currently populated.
37
func (storage *MongoStorage) CreateAccount(account *Account) error {
38
return storage.accounts().Insert(account)
39
40
41
+// FindAccount queries for an existing account with a specified name. If no such account exists,
42
+// nil is returned.
43
func (storage *MongoStorage) FindAccount(name string) (*Account, error) {
44
var account Account
45
err := storage.accounts().FindId(name).One(&account)
0 commit comments