我在 python 3.8 上使用 neomodel==4.0.1
当我使用 get 方法搜索存储时,我使用整数属性进行结构化节点名称存储,code
但无法找到任何匹配项
StoreNodeDoesNotExist
----> 1 StoreNode.nodes.get(code='23416')
app/.env/lib/python3.8/site-packages/neomodel/match.py in get(self, lazy, **kwargs)
605 raise MultipleNodesReturned(repr(kwargs))
606 elif not result:
--> 607 raise self.source_class.DoesNotExist(repr(kwargs))
608 else:
609 return result[0]
StoreNodeDoesNotExist: (StoreNodeDoesNotExist(...), "{'code': '23416'}")
或者
StoreNodeDoesNotExist
----> 1 StoreNode.nodes.get(code=23416)
app/.env/lib/python3.8/site-packages/neomodel/match.py in get(self, lazy, **kwargs)
605 raise MultipleNodesReturned(repr(kwargs))
606 elif not result:
--> 607 raise self.source_class.DoesNotExist(repr(kwargs))
608 else:
609 return result[0]
StoreNodeDoesNotExist: (StoreNodeDoesNotExist(...), "{'code': 23416}")
另一方面,如果我运行 cypher 它匹配
In [9]: results, columns = db.cypher_query("MATCH (n:StoreNode{code:'23416'}) return n;",)
In [10]: [StoreNode.inflate(row[0]) for row in results]
Out[10]: [<StoreNode: {'created_on': datetime.datetime(2020, 11, 17, 7, 31, 49, 262277, tzinfo=<UTC>), 'modified_on': None, 'delivery_status': None, 'name': 'Ll Shop (23416) ', 'code': 23416, 'id': 145798}>]
有人可以解释原因以及如何更正我以前的新模型查询吗?