Did I find the right examples for you? yes no

All Samples(1440)  |  Call(976)  |  Derive(10)  |  Import(454)
Connection to MongoDB.
    

src/h/p/hpfeeds-HEAD/examples/basic_mongodb.py   hpfeeds(Download)
def get_db(host, port, name, user = '', passwd = ''):
        dbconn = pymongo.Connection(host, port)
        db = pymongo.database.Database(dbconn, name)
	if user != '' or passwd != '':
        	db.authenticate(user, passwd)
def main():
	hpc = hpfeeds.new(HOST, PORT, IDENT, SECRET)
	print >>sys.stderr, 'connected to', hpc.brokername
 
	insertCon = pymongo.Connection(host="localhost",port=27017)

src/p/u/pureodm-HEAD/examples/query_user.py   pureodm(Download)
 
if __name__ == '__main__':
    connection = pymongo.Connection(host='localhost', port=27017)
    database = connection['pureodmTest']
    users = database['users']

src/p/u/pureodm-HEAD/examples/create_user.py   pureodm(Download)
 
if __name__ == '__main__':
    connection = pymongo.Connection(host='localhost', port=27017)
    database = connection['pureodmTest']
    users = database['users']

src/p/u/pureodm-HEAD/examples/create_article.py   pureodm(Download)
 
if __name__ == '__main__':
	connection = pymongo.Connection(host='localhost', port=27017)
	database = connection['pureodmTest']
	articles = database['articles']

src/p/u/pureodm-HEAD/examples/change_password.py   pureodm(Download)
 
if __name__ == '__main__':
    connection = pymongo.Connection(host='localhost', port=27017)
    database = connection['pureodmTest']
    users = database['users']

src/c/h/CherrypyMongoDB-0.2.1/mongodb_tool.py   CherrypyMongoDB(Download)
def get_connection(host='localhost', port=27017, max_pool_size=10, network_timeout=None,tz_aware=False):
    return pymongo.Connection(
                host=host,
                port=port,
                max_pool_size=max_pool_size,

src/n/a/nagios-plugin-mongodb-HEAD/check_mongodb.py   nagios-plugin-mongodb(Download)
                con = pymongo.MongoClient(host, port)
            else:
                con = pymongo.Connection(host, port, read_preference=pymongo.ReadPreference.SECONDARY, ssl=ssl, replicaSet=replica, network_timeout=10)
        else:
            if replica is None:
                con = pymongo.Connection(host, port, slave_okay=True, network_timeout=10)
            else:
                con = pymongo.Connection(host, port, slave_okay=True, network_timeout=10)

src/m/o/mongodb-d4-HEAD/src/inputs/mongodb/samplecreator.py   mongodb-d4(Download)
import json
import logging
from pymongo import Connection
import random
import string
 
    # Initialize connection to db that stores raw transactions
    connection = Connection(hostname, port)
    target_db = connection[t_db]
 

src/1/0/10GenM101Course-HEAD/1stWeek/1st_week_example_complete.py   10GenM101Course(Download)
def index():
	from pymongo import Connection
	connection = Connection('localhost', 27017)
 
	db = connection.test

src/m/o/MongoHub-HEAD/Resources/mongodb.py   MongoHub(Download)
from time import *
from datetime import datetime
from pymongo import Connection as MongoConnection
from pymongo import database
from pymongo import collection as MongoCollection
    def show_dbs(self, host, port):
        try:
            c = MongoConnection(host=host, port=int(port), pool_size=1)
            dbs = c.database_names()
        except Exception, err:
    def show_collections(self, host, port, dbname):
        try:
            c = MongoConnection(host=host, port=int(port), pool_size=1)
            db = database.Database(c, dbname)
            collections = db.collection_names()
    def drop_collection(self, host, port, dbname, collection_name):
        try:
            c = MongoConnection(host=host, port=int(port), pool_size=1)
            db = database.Database(c, dbname)
            db.drop_collection(collection_name)
    def drop_database(self, host, port, dbname):
        try:
            c = MongoConnection(host=host, port=int(port), pool_size=1)
            c.drop_database(dbname)
        except Exception, err:

  1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9  Next