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

select with explicit fields will pack by fake record ? #2290

Closed
paynechu opened this issue Apr 29, 2014 · 14 comments
Closed

select with explicit fields will pack by fake record ? #2290

paynechu opened this issue Apr 29, 2014 · 14 comments
Assignees
Labels

Comments

@paynechu
Copy link

fake record packed again ?
so we need always duel with them ?
I suppose just return @Rid, @Version and roles.
tested version: 1.7-SNAPSHOT (develop) and 1.6.6

screen shot 2014-04-29 at 11 04 49 am

@lvca
Copy link
Member

lvca commented Apr 29, 2014

This seems a bug of Studio, may you open the very same issue in: https://github.com/orientechnologies/orientdb-studio/issues?state=open

@lvca lvca closed this as completed Apr 29, 2014
@lvca lvca self-assigned this Apr 29, 2014
@paynechu
Copy link
Author

I don't think this only Studio bug.
Because I also got same return from Binary Protocol.

@lvca
Copy link
Member

lvca commented Apr 29, 2014

With the console or API? If the console, after the result, can you execute:

display record 0

@paynechu
Copy link
Author

I think this issue is everywhere not only Studio.
console and binary protocol (self implemented driver) all return same result

screen shot 2014-04-29 at 5 50 31 pm

@lvca
Copy link
Member

lvca commented Apr 29, 2014

So the items are present, and by default the collections show only the size. The problem is not in OrientDB but in Studio.

@paynechu
Copy link
Author

why Studio ?
you can see the console's resultset also packed by fake record
id suppose is #5:0 but now is #-2:1 same as Studio

what I expect the result should like

----------------------------------------------------------------------------
ODocument - Class: OUser     id: #5:0        v.1
----------------------------------------------------------------------------
          roles : [#4:0-#4:0]

But now like

----------------------------------------------------------------------------
ODocument - Class: null     id: #-2:1        v.0
----------------------------------------------------------------------------
              rid : #5:0
       version : 1
          roles : [#4:0-#4:0]

That mean a fake record packed it

@lvca
Copy link
Member

lvca commented Apr 29, 2014

I thought you was referring to the collection, sorry. However it's normal. Every time you do a projection in select OrientDB creates a temporary record to host the result. If you do:

select from ouser

You'd have what you expecting. This is to avoid you save back the documents: all the missing fields would be removed.

@paynechu
Copy link
Author

sure if I always get all fields~
But I think avoid to save partial data back to database should user(app developer) job right ?
seems should not the database's job.
and the class name also missed ~ so make the partial query less useful

@lvca
Copy link
Member

lvca commented Apr 29, 2014

You could also use include() or exclude() functions to remove things from the result set.

@paynechu
Copy link
Author

include and exclude seems for embedded fields.
no help on this issue

@paynechu
Copy link
Author

I suggest should mark this issue to improvement not invalid
I don't see other database will treat the partial query is another record
Just helping to improve OrientDB.

@lvca
Copy link
Member

lvca commented Apr 29, 2014

Why do you need partial results?

@paynechu
Copy link
Author

Why not ?
not everyone always just use ORM right ?

@lvca
Copy link
Member

lvca commented Apr 29, 2014

We can't support this because as I said, once back the record could be updated with its rid. This will generate many common pitfalls for users.

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