1

我正在尝试使用 python API 计算基础中的实例:

q = '''match
        $x isa processo;
        get $x; count;'''

with TypeDB.core_client("localhost:1729") as client:
    with client.session(keyspace, SessionType.DATA) as session:
        with session.transaction(TransactionType.READ) as read_transaction:
                    
            result = read_transaction.query().match_aggregate(q)
            print(result.get())

这打印:

<typedb.concept.answer.numeric._Numeric object at 0x00000256FCB8AA00>

我怎样才能得到结果数字?

4

1 回答 1

2

我使用以下方法得到了正确的结果:

print(result.get().as_int())

于 2021-10-25T14:13:27.800 回答