question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

.include misbehave with @rid

See original GitHub issue

Reopening #3587, this time no typos.

Query 1

select *, inE('puntua').include('comida', 'servicio', 'extras') as puntuaciones, inE('puntua') as taster from Sitio

Result:

{
    "result": [
        {
            "@type": "d",
            "@rid": "#13:0",
            "@version": 7,
            "@class": "sitio",
            "in_come": [
                "#14:3",
                "#14:4",
                "#14:7"
            ],
            "nickname": "alejox",
            "nombre": "El Navegante del Sabor",
            "in_puntua": [
                "#15:0"
            ],
            "puntuaciones": [
                {
                    "@type": "d",
                    "@version": 0,
                    "comida": 8,
                    "servicio": 7,
                    "extras": 5
                }
            ],
            "taster": [
                "#15:0"
            ],
            "@fieldTypes": "in_come=g,in_puntua=g,puntuaciones=z,taster=z"
        }
// ....
    ],
    "notification": "Query executed in 0.043 sec. Returned 2 record(s)"
}

Query 2

select *, inE('puntua').include('@rid', 'comida', 'servicio', 'extras') as puntuaciones, inE('puntua') as taster from Sitio

Result:

{
    "result": [
        {
            "@type": "d",
            "@rid": "#13:0",
            "@version": 7,
            "@class": "sitio",
            "in_come": [
                "#14:3",
                "#14:4",
                "#14:7"
            ],
            "nickname": "alejox",
            "nombre": "El Navegante del Sabor",
            "in_puntua": [
                "#15:0"
            ],
            "puntuaciones": [
                "#15:0"
            ],
            "taster": [
                "#15:0"
            ],
            "@fieldTypes": "in_come=g,in_puntua=g,puntuaciones=z,taster=z"
        },
       // ...
        }
    ],
    "notification": "Query executed in 0.057 sec. Returned 2 record(s)"
}

Notice how puntuaciones became an array with only RID, and the other columns where omitted.

Issue Analytics

  • State:closed
  • Created 9 years ago
  • Comments:10 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
luigidellaquilacommented, Nov 2, 2017

Hi guys,

I’m afraid we cannot do much for this in v 2.2.x. Each element in the list is a document, if it has an invalid RID it’s considered as an embedded document and it’s serialized as it is; if it has a regular RID it’s considered a linked document, so only the RID is serialized (except if you have an explicit FETCHPLAN that changes this behavior).

So the solution for now is only to have a proper fetchplan in the query.

Good news is that in V 3.0 we completely changed this logic, we deprecated fetchplans and added nested projections (see http://orientdb.com/docs/3.0.x/sql/SQL-Projections.html#nested-projections), this will hopefully solve the problem once and forever

Thanks

Luigi

0reactions
luigidellaquilacommented, Jun 22, 2018

OrientDB v 3.0 solves problems related to FETCHPLAN and include() with nested projections ( https://orientdb.com/docs/3.0.x/sql/SQL-Projections.html#nested-projections ), so this issue is no longer relevant.

Closing, thanks

Luigi

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to react when somebody misbehaves or talks rudely?
Q: How to react with others when somebody misbehave or talk rudely, scold even we are not in fault etc.? We have to...
Read more >
How To Correct Bad Employee Behavior Before It Gets Out Of ...
The employee should propose the solution so they have ownership. ... If there is a bad apple in the bunch, get rid of...
Read more >
How can I regain a professional atmosphere with someone ...
I believe a female colleague saw me masturbating at work. I was in my office after hours with the door locked and blinds...
Read more >
c# - EF Core - adding/updating entity and ... - Stack Overflow
Id)) { // Map the DTO to child entity and add it to the collection entity.Children.Add(Mapper. ... Where(c => c.rid == objCas.rid &...
Read more >
(5) "beginning of school the prescription, followed by ... - ERIC
"teaching rules and procedures"--lesson plans should include rules or ... During the week the names Df students who misbehaved.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found