mongo/funcs/crud_mongo.py
def insert(collection):
    """Insert item inside collection in database.

    insert_one: insert one item in the collection.
    insert_many: insert many itens in the collection.

    Keyword arguments:
    collection -- Name of the collection on database.
    """
    quant = int(input('How many itens you want to insert: '))
    properties = int(input('How much properties this item have? '))
    itens_input = [{
    input('Enter key name: '): input('Enter value: ') for x in range(properties)
    } for i in range(quant)]
    if quant == 1:
        collection.insert_one(itens_input[0])
    if quant > 1:
        collection.insert_many(itens_input)
Insert item inside collection in database.

    insert_one: insert one item in the collection.
    insert_many: insert many itens in the collection.

    Keyword arguments:
    collection -- Name of the collection on database.
    
Insert item inside collection in database.
insert_one: insert one item in the collection.
insert_many: insert many itens in the collection.

Keyword arguments:
collection -- Name of the collection on database.
Insert item inside collection in database . insert_one : insert one item in the collection . insert_many : insert many itens in the collection . Keyword arguments : collection -- Name of the collection on database .
def insert(collection):
    quant = int(input('How many itens you want to insert: '))
    properties = int(input('How much properties this item have? '))
    itens_input = [{
    input('Enter key name: '): input('Enter value: ') for x in range(properties)
    } for i in range(quant)]
    if quant == 1:
        collection.insert_one(itens_input[0])
    if quant > 1:
        collection.insert_many(itens_input)
def insert ( collection ) : quant = int ( input ( 'How many itens you want to insert: ' ) ) properties = int ( input ( 'How much properties this item have? ' ) ) itens_input = [ { input ( 'Enter key name: ' ) : input ( 'Enter value: ' ) for x in range ( properties ) } for i in range ( quant ) ] if quant == 1 : collection . insert_one ( itens_input [ 0 ] ) if quant > 1 : collection . insert_many ( itens_input )
Insert item inside collection in database.
Insert item inside collection in database .
"""Insert item inside collection in database.

    insert_one: insert one item in the collection.
    insert_many: insert many itens in the collection.

    Keyword arguments:
    collection -- Name of the collection on database.
    """
collection