Code Monkey home page Code Monkey logo

Comments (4)

shinhanbyeol avatar shinhanbyeol commented on June 15, 2024

I don't know English well, so I don't know if I understood your question well. If I understood your question well,
I think this question can explain your curiosity.

CREATE EXTENSION age;
LOAD 'age';
SET search_path = ag_catalog, "postgres", public;

SELECT create_graph('test_graph');

SELECT * from cypher('test_graph', $$
CREATE (a:Part {part_num: '123'}),
(b:Part {part_num: '345'}),
(c:Part {part_num: '456'}),
(d:Part {part_num: '789'})
$$) as (a agtype);

select * from cypher('test_graph', $$ match(v:Part) where id(v) = 844424930131969 return v.part_num $$) as (result text);

with a as(select * from cypher('test_graph', $$ match(v:Part) where id(v) = 844424930131969 return v.part_num $$) as (result text))
select a from a;

  1. If the cypher query result is in text format, you can cast it in text format.
  2. To query using a specific id value, you can use the id function where id function.

from age.

Halkrine avatar Halkrine commented on June 15, 2024

Of course, it returns text type when I use cypher query only(as (result text)).
I want know when I use 'with', how I get data that I wanted type.

Here is returned value in queried that.
1111

from age.

shinhanbyeol avatar shinhanbyeol commented on June 15, 2024

Is this what you want?

select "result", "id" from cypher('test_graph', $$ match(v:Part) where id(v) = 844424930131969 return v.part_num , id(v) $$) as (result text, id text);

with a as(
select * from cypher('test_graph', $$ match(v:Part) where id(v) = 844424930131969 return v.part_num , id(v) $$) as (result text, id text)
)
select "result", "id" from a;

image

from age.

Halkrine avatar Halkrine commented on June 15, 2024

Oh yes. it's correct.

Thanks to reply.

from age.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.