I would like to do something like this
contents = contents.find() # get all from collection
if user filled search box 1:
contents = contents.find({'field1':seached_var})
if user filled search box 2:
contents = contents.find({'field2':seached_var2})
contents would contain the final filtered result. Is it doable in python with mongodb?