devicemngmt/db.go

16 lines
308 B
Go
Raw Normal View History

2021-11-08 10:23:03 +00:00
package devicemngmt
import (
"fmt"
"go.mongodb.org/mongo-driver/mongo"
)
// getDeviceCollection ...
func (s Service) getDeviceCollection() *mongo.Collection {
if s.TablePrefix != "" {
return s.DB.Collection(fmt.Sprintf("%s-%s", s.TablePrefix, tableDevice))
}
return s.DB.Collection(tableDevice)
}