(self, include_system_collections=True)
return names
Get a list of all the collection names in this database.

        :Parameters:
          - `include_system_collections` (optional): if ``False`` list
            will not include system collections (e.g ``system.indexes``)
Get a list of all the collection names in this database.
Get a list of all the collection names in this database .
def collection_names(self, include_system_collections=True):
        """Get a list of all the collection names in this database.

        :Parameters:
          - `include_system_collections` (optional): if ``False`` list
            will not include system collections (e.g ``system.indexes``)
        """
        with self.__client._socket_for_reads(
                ReadPreference.PRIMARY) as (sock_info, slave_okay):

            wire_version = sock_info.max_wire_version
            results = self._list_collections(sock_info, slave_okay)

        # Iterating the cursor to completion may require a socket for getmore.
        # Ensure we do that outside the "with" block so we don't require more
        # than one socket at a time.
        names = [result["name"] for result in results]
        if wire_version <= 2:
            # MongoDB 2.4 and older return index namespaces and collection
            # namespaces prefixed with the database name.
            names = [n[len(self.__name) + 1:] for n in names
                     if n.startswith(self.__name + ".") and "$" not in n]

        if not include_system_collections:
            names = [name for name in names if not name.startswith("system.")]
        return names
def collection_names ( self , include_system_collections = True ) : with self . __client . _socket_for_reads ( ReadPreference . PRIMARY ) as ( sock_info , slave_okay ) : wire_version = sock_info . max_wire_version results = self . _list_collections ( sock_info , slave_okay ) # Iterating the cursor to completion may require a socket for getmore. # Ensure we do that outside the "with" block so we don't require more # than one socket at a time. names = [ result [ "name" ] for result in results ] if wire_version <= 2 : # MongoDB 2.4 and older return index namespaces and collection # namespaces prefixed with the database name. names = [ n [ len ( self . __name ) + 1 : ] for n in names if n . startswith ( self . __name + "." ) and "$" not in n ] if not include_system_collections : names = [ name for name in names if not name . startswith ( "system." ) ] return names