当前位置: 首页>>代码示例>>Python>>正文


Python Connection.find方法代码示例

本文整理汇总了Python中pymongo.connection.Connection.find方法的典型用法代码示例。如果您正苦于以下问题:Python Connection.find方法的具体用法?Python Connection.find怎么用?Python Connection.find使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在pymongo.connection.Connection的用法示例。


在下文中一共展示了Connection.find方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1:

# 需要导入模块: from pymongo.connection import Connection [as 别名]
# 或者: from pymongo.connection.Connection import find [as 别名]
# for F in li[0:1]:
    count += 1
    print "%d of %d: %s" % (count, tot, F)
    degree, weight, A, B, hodge, gal2, gal3, gal5, gal7  = F
    Astr = '.'.join([str(x) for x in A])
    Bstr = '.'.join([str(x) for x in B])
    label = "A%s_B%s" % (Astr, Bstr)
    data = {
        'label': label,
        'degree': degree,
        'weight': weight,
        'A': A,
        'B': B,
	'hodge': hodge,
	'gal2': gal2,
	'gal3': gal3,
	'gal5': gal5,
	'gal7': gal7
    }
    is_new = True
    for field in hgm.find({'label': label}):
	is_new = False
	break

    if is_new:
	    print "new family"
	    hgm.save(data)
    else:
	print "Have this one"

开发者ID:MarkWatkins2014,项目名称:lmfdb,代码行数:31,代码来源:import_hgmfam.py

示例2: coeff_to_poly

# 需要导入模块: from pymongo.connection import Connection [as 别名]
# 或者: from pymongo.connection.Connection import find [as 别名]
    pol = coeff_to_poly(coeffs)
    K = NumberField(pol, 'a')
    D = str(D)
    data = {
        'degree': d,
        'disc_abs_key': dstr,
        'disc_sign': s,
        'ramps': ramps,
        'coeffs': makels(coeffs),
        'signature': makels(sig)
    }
    index = 1
    is_new = True
    holdfield = ''
    for field in fields.find({'degree': d,
                              'signature': data['signature'],
                              'disc_abs_key': dstr}):
        index += 1
        if field['coeffs'] == data['coeffs']:
            holdfield = field
            is_new = False
            break

    if is_new:
        print "new field"
        label = base_label(d, sig[0], absD, index)
        info = {'label': label}
        try:
            cltime = time.time()
            h, clg, uk, reg = getclgroup(K)
            cltimeend = time.time()
开发者ID:anneschilling,项目名称:lmfdb,代码行数:33,代码来源:import_jjnf_data.py

示例3: abs

# 需要导入模块: from pymongo.connection import Connection [as 别名]
# 或者: from pymongo.connection.Connection import find [as 别名]
    t = time.time()
    d, sig, D, coeffs, h, cyc, GG = F
    absD = abs(D)
    data = {
        "degree": d,
        "signature": sig,
        "discriminant": D,
        "coefficients": coeffs,
        "class_number": h,
        "class_group": cyc,
        "galois_group": GG,
    }

    index = 1
    is_new = True
    for field in fields.find({"degree": d, "signature": sig, "discriminant": D}):
        index += 1
        if field["coefficients"] == coeffs:
            is_new = False
            break

    if is_new:
        print "new field"
        label = base_label(d, sig[0], absD, index)
        info = {"label": label}
        info.update(data)
        print "entering %s into database" % info
        fields.save(info)
    else:
        print "field already in database"
    if time.time() - t > 5:
开发者ID:swisherh,项目名称:swisherh-logo,代码行数:33,代码来源:import_jjnf_data.py

示例4:

# 需要导入模块: from pymongo.connection import Connection [as 别名]
# 或者: from pymongo.connection.Connection import find [as 别名]
        't': t,
        'u': u,
        'unram': unram,
        'eisen': eisen,
        'rf': rf,
        'hw': hw,
        'gms': gms,
        'aut': aut,
        'galT': galT
    }

    index = 1
    is_new = True
    holdfield = {}
    for field in fields.find({'p': p,
                              'n': n,
                              'c': c}):
        index += 1
        if field['coeffs'] == coeffs:
            is_new = False
            holdfield = field
            break

    if is_new:
        print "new field"
        label = base_label(p, n, c, index)
        info = {'label': label}
        info.update(data)
        print "entering %s into database" % info
        fields.save(info)
    else:
开发者ID:anneschilling,项目名称:lmfdb,代码行数:33,代码来源:import_fields.py


注:本文中的pymongo.connection.Connection.find方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。