(self, namespace)
return namespace_tuple
Converts a mongodb namespace to a db, collection tuple
Converts a mongodb namespace to a db, collection tuple
Converts a mongodb namespace to a db collection tuple
def _tuplefy_namespace(self, namespace):
        """Converts a mongodb namespace to a db, collection tuple"""
        namespace_split = namespace.split('.', 1)
        if len(namespace_split) is 1:
            # we treat a single element as a collection name.
            # this also properly tuplefies '*'
            namespace_tuple = ('*', namespace_split[0])
        elif len(namespace_split) is 2:
            namespace_tuple = (namespace_split[0],namespace_split[1])
        else:
            return None
        return namespace_tuple
def _tuplefy_namespace ( self , namespace ) : namespace_split = namespace . split ( '.' , 1 ) if len ( namespace_split ) is 1 : # we treat a single element as a collection name. # this also properly tuplefies '*' namespace_tuple = ( '*' , namespace_split [ 0 ] ) elif len ( namespace_split ) is 2 : namespace_tuple = ( namespace_split [ 0 ] , namespace_split [ 1 ] ) else : return None return namespace_tuple