annotate backend/couchdb/scripts/findUnlinkedArticles.py @ 255:b4c83e9b9c7a

migration from couchdb to arangodb
author Dirk Olmes <dirk@xanthippe.ping.de>
date Thu, 29 Nov 2018 18:46:21 +0100
parents 5bbb1e707e56
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
237
5bbb1e707e56 add maintainance script
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
diff changeset
1 #!/usr/bin/env python
5bbb1e707e56 add maintainance script
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
diff changeset
2
5bbb1e707e56 add maintainance script
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
diff changeset
3 import couchdb
5bbb1e707e56 add maintainance script
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
diff changeset
4
5bbb1e707e56 add maintainance script
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
diff changeset
5 server = couchdb.Server('http://xanthippe:5984')
5bbb1e707e56 add maintainance script
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
diff changeset
6 database = server['feedworm']
5bbb1e707e56 add maintainance script
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
diff changeset
7
5bbb1e707e56 add maintainance script
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
diff changeset
8 #result = database.view('feedworm/feeds_with_unread_entries', group=True)
5bbb1e707e56 add maintainance script
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
diff changeset
9 #for entry in result:
5bbb1e707e56 add maintainance script
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
diff changeset
10 ## print(entry.key)
5bbb1e707e56 add maintainance script
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
diff changeset
11 # try:
5bbb1e707e56 add maintainance script
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
diff changeset
12 # document = database[entry.key]
5bbb1e707e56 add maintainance script
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
diff changeset
13 # except:
5bbb1e707e56 add maintainance script
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
diff changeset
14 # print('no doc for feed {0}'.format(entry.key))
5bbb1e707e56 add maintainance script
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
diff changeset
15
5bbb1e707e56 add maintainance script
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
diff changeset
16 #feed = '326ab7561eaadee0773c88262906a0a4'
5bbb1e707e56 add maintainance script
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
diff changeset
17 #result = database.view('feedworm/feedEntries_by_feed', startkey=[feed], endkey=[feed, {}])
5bbb1e707e56 add maintainance script
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
diff changeset
18 #for row in result:
5bbb1e707e56 add maintainance script
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
diff changeset
19 # #del database[row.id]
5bbb1e707e56 add maintainance script
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
diff changeset
20 # print(row.id)
5bbb1e707e56 add maintainance script
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
diff changeset
21
5bbb1e707e56 add maintainance script
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
diff changeset
22 feed = '12cd35559a627cc7f4b43d213b24201d'
5bbb1e707e56 add maintainance script
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
diff changeset
23 result = database.view('feedworm/feedEntries_by_feed', startkey=[feed], endkey=[feed, {}])
5bbb1e707e56 add maintainance script
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
diff changeset
24 for row in result:
5bbb1e707e56 add maintainance script
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
diff changeset
25 print(row)