Created
February 27, 2013 01:02
RouteFlow database query script for debug purposes
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
from pymongo import Connection | |
def usage(): | |
print('Usage: %s <channel>' % sys.argv[0]) | |
print(' channel: "rfclient" or "rfproxy"') | |
sys.exit(1) | |
if __name__ == '__main__': | |
connection = Connection('localhost', 27017) | |
db = connection['db'] | |
chan1 = db['rfclient<->rfserver'] | |
chan2 = db['rfserver<->rfproxy'] | |
if (len(sys.argv) < 2): | |
usage() | |
if (sys.argv[1] == 'rfclient'): | |
for entry in chan1.find(): | |
print(entry) | |
elif (sys.argv[1] == 'rfproxy'): | |
for entry in chan2.find(): | |
print(entry) | |
else: | |
usage() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment