简体   繁体   English

Neo4j C#转换为整数密码

[英]Neo4j c# toInteger cypher

I have a database that stores client's tickets bought. 我有一个数据库,用于存储购买的客户门票。 It stores the quantity of tickets sold in each relationship, I need to display the events ordered by the quantity in each relationship. 它存储每个关系中售出的门票数量,我需要显示每个关系中按数量订购的事件。 The problem is that said quantity is stored as an integer, researching i found the toInteger() function that converts the strings into integers and then I get the ordered list. 问题是该数量存储为整数,研究发现我将toInteger()函数将字符串转换为整数,然后得到有序列表。 But when I try to implement said cypher in my C# application I cannot find a way to use toInteger() . 但是,当我尝试在我的C#应用​​程序中实现所述密码时,我找不到使用toInteger()

Neo4j Cypher (that works correctly) Neo4j Cypher(正常工作)

MATCH(Cliente)-[r:Compro]->(b) return b.nombreEvento order by toInteger(r.cantidad) desc limit 5

C# Cypher Try C#密码尝试

graphClient.Cypher
            .Match("(Cliente) -[r: Compro]->(b)")
            .Return(b => b.As<Cine>().nombreEvento)
            .OrderByDescending("r.cantidad")
            .Limit(5)
            .Results.ToList();

I am using Neo4jClient package for C#. 我正在为C#使用Neo4jClient软件包。

Does anyone know if said function can be used in Neo4jClient? 有谁知道Neo4jClient是否可以使用上述功能? Or help me by pointing me in the right direction. 或者通过指出正确的方向来帮助我。

Simply add in the .OrderByDescending() the toInteger() function like a string. 只需在.OrderByDescending()中像字符串一样添加toInteger()函数。

For example: 例如:

order by toInteger(r.cantidad) desc

would become: 会成为:

.OrderByDescending("toInteger(r.cantidad)")

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM