//CheckIfCollectionExists is used to check if a further DB initialisation is required.
//Returns true if a Collection with that name exists
CheckIfCollectionExists is used to check if a further DB initialisation is required.
Returns true if a Collection with that name exists
// CheckIfCollectionExists is used to check if a further DB initialisation is required . // Returns true if a Collection with that name exists
func (db *DB) CheckIfCollectionExists(collectionName string) (bool, error) {
	names, err := db.Client.Database(db.DatabaseName).ListCollectionNames(context.TODO(), bson.D{})
	if err != nil {
		return false, err
	}
	for _, name := range names {
		if name == collectionName {
			return true, nil
		}
	}
	return false, nil
}
func ( db * DB ) CheckIfCollectionExists ( collectionName string ) ( bool , error ) { names , err := db . Client . Database ( db . DatabaseName ) . ListCollectionNames ( context . TODO ( ) , bson . D { } ) if err != nil { return false , err } for _ , name := range names { if name == collectionName { return true , nil } } return false , nil }
CheckIfCollectionExists is used to check if a further DB initialisation is required.
CheckIfCollectionExists is used to check if a further DB initialisation is required .
//Bloody Pointers