def json_obj_to_cursor ( self , json ) : cursor = json_util . loads ( json ) if "id" in json : cursor [ "_id" ] = ObjectId ( cursor [ "id" ] ) del cursor [ "id" ] return cursor
python mongodb string to objectid
( Deprecated ) Converts a JSON object to a mongo db cursor
def json_obj_to_cursor(self, json):
        """(Deprecated) Converts a JSON object to a mongo db cursor

        :param str json: A json string
        :returns: dictionary with ObjectId type
        :rtype: dict
        """
        cursor = json_util.loads(json)
        if "id" in json:
            cursor["_id"] = ObjectId(cursor["id"])
            del cursor["id"]

        return cursor