diff options
-rw-r--r-- | db/mongodb/client.go | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/db/mongodb/client.go b/db/mongodb/client.go index 82082fc..8180991 100644 --- a/db/mongodb/client.go +++ b/db/mongodb/client.go | |||
@@ -13,6 +13,12 @@ import ( | |||
13 | "code.crute.us/mcrute/golib/vault" | 13 | "code.crute.us/mcrute/golib/vault" |
14 | ) | 14 | ) |
15 | 15 | ||
16 | // AnyInTopLevelArray is just a convenience method so apps don't have to repeat | ||
17 | // this ugly bson expression. | ||
18 | func AnyInTopLevelArray(k string, v interface{}) bson.M { | ||
19 | return bson.M{k: bson.M{"$all": bson.A{v}}} | ||
20 | } | ||
21 | |||
16 | type Mongo struct { | 22 | type Mongo struct { |
17 | client *mongo.Client | 23 | client *mongo.Client |
18 | db *mongo.Database | 24 | db *mongo.Database |