A PHP Error was encountered

Severity: 8192

Message: filter_var(): Passing null to parameter #3 ($options) of type array|int is deprecated

Filename: core/Input.php

Line Number: 572

Backtrace:

File: /usr/share/webapps/Stikked/htdocs/application/models/Pastes.php
Line: 522
Function: ip_address

File: /usr/share/webapps/Stikked/htdocs/application/controllers/Main.php
Line: 592
Function: getPaste

File: /usr/share/webapps/Stikked/htdocs/index.php
Line: 284
Function: require_once

connect to mongo - Stikked

connect to mongo

From paxton, 6 Years ago, written in Python, viewed 1'689 times.
URL http://stikked.luisaranguren.com/view/ad21561a Embed
Download Paste or View Raw
  1.  
  2. import json
  3. with open('/Users/paxtongerrish/Dropbox/mongo_db_credentials', mode='r') as f:
  4.     mongo_credentials = json.loads(f.read())
  5.  
  6.  
  7. import pymongo
  8. client = pymongo.MongoClient(host=mongo_credentials['uri'], port=mongo_credentials['port'])
  9.  
  10. mongo_database = client[mongo_credentials['database_name']]
  11. mongo_database.authenticate(mongo_credentials['user_name'], password=mongo_credentials['user_password'])
  12.  
  13. toolset_names = mongo_database.collection_names(include_system_collections=False)
  14.  
  15. for toolset_name in toolset_names:
  16.     document = mongo_database[toolset_name]
  17.     mongo_curser = document.find()
  18.     for x in mongo_curser:
  19.         print x
  20.  

Reply to "connect to mongo"

Here you can reply to the paste above