# -*- coding: utf-8 -*- # !/usr/bin/env python """ """ import os import sys from bson.decimal128 import Decimal128 #: current_dir - 2 PROJECT_ROOT = os.path.join(os.path.abspath(os.path.split(os.path.realpath(__file__))[0] + "/.."), '..') sys.path.insert(0, PROJECT_ROOT) from script.base import init_env, get_logger logger = get_logger(__name__) init_env(interactive=True) from apps.web.agent.models import Agent updated = Agent.objects(id='5b9cb1484864d011b02cd0f4').update(set__trafficCardCost=Decimal128('15')) print 'updated', updated, 'agentId=5b9cb1484864d011b02cd0f4'