Python script to search and store data in Mongo