Here Is my try to remove document with article_link:x
>>> db = client.article_db
>>> collection1 = db.article0510
>>> collection1.remove('article_link': 'http://www.moneycontrol.com/news/stocks-views/bet-for-long-termbharat-forge-hemant-thukral_3414941.html')
File "<stdin>", line 1
collection1.remove('article_link': 'http://www.moneycontrol.com/news/stocks-views/bet-for-long-termbharat-forge-hemant-thukral_3414941.html')
^
SyntaxError: invalid syntax
Here is my python script:
bse_tagged_link = ['http://www.business-standard.com/article/finance/sfio-probes-10-firms-in-bob-case-115102900994_1.html']
for link in bse_tagged_link:
lookup_result = self.collection1.find({'article_link': link})
print lookup_result
for val in lookup_result:
if val and val != 'None':
print val
self.collection1.remove({'article_link': var['article_link']})
What I want to do is:
- Get set of links from table1
- lookup links from point
1into table 2 - If link present in table2, remove those record