Skip to content

Instantly share code, notes, and snippets.

Created February 27, 2013 01:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save anonymous/5043961 to your computer and use it in GitHub Desktop.
Save anonymous/5043961 to your computer and use it in GitHub Desktop.
RouteFlow database query script for debug purposes
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