// splitNamespace split's a mongo namespace by the first '.' into a database and a collection
splitNamespace split's a mongo namespace by the first '.' into a database and a collection
// splitNamespace split ' s a mongo namespace by the first ' . ' into a database and a collection
func (m *Mongodb) splitNamespace(namespace string) (string, string, error) {
	fields := strings.SplitN(namespace, ".", 2)
	if len(fields) != 2 {
		return "", "", fmt.Errorf("malformed mongo namespace")
	}
	return fields[0], fields[1], nil
}
func ( m * Mongodb ) splitNamespace ( namespace string ) ( string , string , error ) { fields := strings . SplitN ( namespace , " " , 2 ) if len ( fields ) != 2 { return " " , " " , fmt . Errorf ( " " ) } return fields [ 0 ] , fields [ 1 ] , nil }
splitNamespace split's a mongo namespace by the first '.'
splitNamespace split ' s a mongo namespace by the first ' . '