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

@rid in result from query is "#-2.0" #7521

Closed
RubenVermeulen opened this issue Jun 30, 2017 · 1 comment
Closed

@rid in result from query is "#-2.0" #7521

RubenVermeulen opened this issue Jun 30, 2017 · 1 comment
Assignees
Labels

Comments

@RubenVermeulen
Copy link

OrientDB Version: 2.2.22

Java Version: 1.8.0_131

OS: Zorin OS 12.1, Ubuntu 16.04 LTS

Expected behavior

#1: SELECT username FROM User WHERE username = "Bob"

"result": [
       {
           "@type": "d",
           "@rid": "#11:1",
           "@version": 0,
           "username": "Bob",
           "@fieldTypes": "rid=x"
       }
   ]

#2: SELECT @Rid, username FROM User WHERE username = "Bob"
"result": [
{
"@type": "d",
"@Rid": "#11:1",
"@Version": 0,
"rid": "#11:1",
"username":"Bob"
"@fieldTypes": "rid=x"
}
]

## Actual behavior  
**#1**: SELECT username FROM User WHERE username = "Bob"

"result": [
{
"@type": "d",
"@Rid": "#-2:0",
"@Version": 0,
"rid": "#11:1",
"username": "Bob",
"@fieldTypes": "rid=x"
}
]

**#2**: SELECT @rid, username FROM User WHERE username = "Bob"
"result": [
        {
            "@type": "d",
            "@rid": "#-2:0",
            "@version": 0,
            "rid": "#120:3750",
            "rid": "#11:1",
            "@fieldTypes": "rid=x"
        }
    ]

Steps to reproduce

See queries above.

@luigidellaquila
Copy link
Member

Hi @RubenVermeulen

This is a legacy behavior that unfortunately cannot be changed in v 2.2.

If you want to include/exclude fields from JSON you can use fetch plans: http://orientdb.com/docs/2.2.x/Fetching-Strategies.html

In v 3.0 it's already fixed.

Thanks

Luigi

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

2 participants