regolith/mongoclient.py
def dump_database(self, db):
        """Dumps a database dict via mongoexport."""
        dbpath = dbpathname(db, self.rc)
        os.makedirs(dbpath, exist_ok=True)
        to_add = []
        colls = self.client[db['name']].collection_names(
                                            include_system_collections=False)
        for collection in colls:
            f = os.path.join(dbpath, collection + '.json')
            cmd = ['mongoexport', '--db',  db['name'],
                   '--collection', collection, '--out', f]
            subprocess.check_call(cmd)
            to_add.append(os.path.join(db['path'], collection + '.json'))
        return to_add
Dumps a database dict via mongoexport.
Dumps a database dict via mongoexport.
Dumps a database dict via mongoexport .
def dump_database(self, db):
        dbpath = dbpathname(db, self.rc)
        os.makedirs(dbpath, exist_ok=True)
        to_add = []
        colls = self.client[db['name']].collection_names(
                                            include_system_collections=False)
        for collection in colls:
            f = os.path.join(dbpath, collection + '.json')
            cmd = ['mongoexport', '--db',  db['name'],
                   '--collection', collection, '--out', f]
            subprocess.check_call(cmd)
            to_add.append(os.path.join(db['path'], collection + '.json'))
        return to_add
def dump_database ( self , db ) : dbpath = dbpathname ( db , self . rc ) os . makedirs ( dbpath , exist_ok = True ) to_add = [ ] colls = self . client [ db [ 'name' ] ] . collection_names ( include_system_collections = False ) for collection in colls : f = os . path . join ( dbpath , collection + '.json' ) cmd = [ 'mongoexport' , '--db' , db [ 'name' ] , '--collection' , collection , '--out' , f ] subprocess . check_call ( cmd ) to_add . append ( os . path . join ( db [ 'path' ] , collection + '.json' ) ) return to_add
Dumps a database dict via mongoexport.
Dumps a database dict via mongoexport .
"""Dumps a database dict via mongoexport."""
self
db