sorry if this is dumb question, but this is the first time i've used python and Mongo DB. Anyway, the problem I have is that I am trying to insert() a string to be stored in my data base -by read()-ing data in with a loop and then giving insert() line 1 and line2 in a single string (This is probably a messy way of doing it but I don't know to make read() read 2 lines at a time.)- but I get this error when running it: TypeError: insert() takes at least 2 arguments (1 given)
from pymongo import MongoClient
client = MongoClient("192.168.1.82", 27017)
db = client.local
collection = db.JsonDat
file_object = open('a.txt', 'r')
post=collection.insert()
readingData = True
def readData():
while readingData==True:
line1 = file_object.readline()
line2 = file_object.readline()
line1
line2
if line1 or line2 == "":
readingData = False
dbData = line1 %line2
post(dbData)
print collection.find()