I am using Python Driver Bolt api.
cypher = MATCH + WHERE + RETURN + LIMIT
records = tx.run(cypher)
result_set = []
for record in records:
tuple = [record['nname'], record['nid']]
if 'mname' in record and 'mid' in record:
tuple.append(record['mname'])
tuple.append(record['mid'])
result_set.append(tuple)
My records optionally contain fields 'mname' and 'mid' in the result set. However, the test fails when these two fields actually contain values:
if 'mname' in record
and 'mid' in record:`
It's not a standard dict in Python. How to check the presence in such a case?