Just started with mongo db .
context = {}
if request.method == 'POST':
context['name'] = request.POST['name']
context['username'] = request.POST['username']
context['mobile'] = request.POST['mobile']
get = db.messages.find( { 'name' : request.POST['name'] } )
if get is not None:
print get.name
I have two records in my database .
> db.messages.find()
{ "_id" : ObjectId("513f2cf1ae4cb53c1374b4f6"), "username" : "[email protected]", "mobile" : "78978555", "name" : "rohit" }
{ "_id" : ObjectId("513f2cfeae4cb53c1374b4f7"), "username" : "[email protected]", "mobile" : "8528522", "name" : "Rohti" }
when i am posting the form with name rohit . I am getting the above error .
Please tell me what might i am doing wrong here .
I know i am doing wrong query in mongo db .Please help me to get back on track .