Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Circular reference when the include method is used in the MATCH command #271

Closed
dastoori opened this issue Jul 21, 2017 · 4 comments
Closed
Assignees
Labels

Comments

@dastoori
Copy link

When I use the include method in the MATCH command, the output has circular reference, but when I write similar query with the SELECT command, the output is fine.

Examples:

MATCH command:

(This is just an example, my real query is much more complex than this)

const stringify = require('json-stringify-safe')

const query = `
MATCH { class: User, as: user }
.out('UserProfile') { as: profile }
RETURN profile.include('name', 'age') as userInfo
`;

const result = await db.select().from(query).all();

console.log(stringify(result));
OrientJS output (Click to open)
[
  {
    "@type": "d",
    "userInfo": "[Circular ~.0]",
    "@rid": "#-1:-1",
    "@version": 0
  },
  {
    "@type": "d",
    "userInfo": {
      "@type": "d",
      "userInfo": "[Circular ~.1.userInfo]",
      "@rid": "#-1:-1",
      "@version": 0
    },
    "@rid": "#-1:-1",
    "@version": 0
  }
]
Studio raw output (Click to open)

{
    "result": [
        {
            "@type": "d",
            "@version": 0,
            "userInfo": {
                "@type": "d",
                "@version": 0,
                "name": "John",
                "age": 32
            }
        },
        {
            "@type": "d",
            "@version": 0,
            "userInfo": {
                "@type": "d",
                "@version": 0,
                "name": "Janet",
                "age": 25
            }
        }
    ],
    "notification": "Query executed in 0.08 sec. Returned 2 record(s)"
}

SELECT command:

const query = `
SELECT out('UserProfile').include('name', 'age') as userInfo
FROM User
`;

const result = await db.select().from(query).all();

console.log(res);
OrientJS output (Click to open)
[
  {
    "@type": "d",
    "userInfo": [{
      "@type": "d",
      "name": "John",
      "age": 32
    }],
    "@rid": "#-2:0",
    "@version": 0
  },
  {
    "@type": "d",
    "userInfo": [{
      "@type": "d",
      "name": "Janet",
      "age": 15
    }],
    "@rid": "#-2:1",
    "@version": 0
  }
]
Studio raw output (Click to open)

{
    "result": [
        {
            "@type": "d",
            "@rid": "#-2:0",
            "@version": 0,
            "userInfo": [
                {
                    "@type": "d",
                    "@version": 0,
                    "name": "John",
                    "age": 32
                }
            ],
            "@fieldTypes": "userInfo=z"
        },
        {
            "@type": "d",
            "@rid": "#-2:1",
            "@version": 0,
            "userInfo": [
                {
                    "@type": "d",
                    "@version": 0,
                    "name": "Janet",
                    "age": 25
                }
            ],
            "@fieldTypes": "userInfo=z"
        }
    ],
    "notification": "Query executed in 0.07 sec. Returned 2 record(s)"
}

If you need more information, let me know.

Thanks

@luigidellaquila luigidellaquila self-assigned this Jul 21, 2017
@dastoori
Copy link
Author

@luigidellaquila, @maggiolo00, What is the status of this issue?

@wolf4ood
Copy link
Member

hi @dastoori

sorry for the late reply. I will try to reproduce it tomorrow and give you a feedback

Thanks

@wolf4ood
Copy link
Member

wolf4ood commented Aug 1, 2017

Hi @dastoori

the issue seems to be on the server. I'm working on a fix.

Thanks

wolf4ood added a commit to orientechnologies/orientdb that referenced this issue Aug 2, 2017
wolf4ood added a commit to orientechnologies/orientdb that referenced this issue Aug 2, 2017
@wolf4ood
Copy link
Member

wolf4ood commented Aug 2, 2017

Hi @dastoori

fixed. It will be available in the next GA release 2.2.25. It should be out soon.

@wolf4ood wolf4ood closed this as completed Aug 2, 2017
@wolf4ood wolf4ood added the bug label Aug 2, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants