I am looking for convinient way to check if object already exists in collection. For now the only way that i have found is
type result interface{} var res re
in the Official Mongo Driver you can get count of documents with specific key using CountDocuments function :
count, err := collection.CountDocuments(context.TODO(), bson.D{{"key", "value"}})