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

Not possible to select attribute with name status #187

Closed
janjilek opened this issue Jul 12, 2016 · 12 comments
Closed

Not possible to select attribute with name status #187

janjilek opened this issue Jul 12, 2016 · 12 comments
Assignees

Comments

@janjilek
Copy link

janjilek commented Jul 12, 2016

When I try to execute query "select status from Gift" via query builder, I receive only following response:
{ '@type': 'd',
'@Rid': { [String: '#-2:99'] cluster: -2, position: 99 },
'@Version': 0 }

As you can see, status is missing. When I try to execute it in console, everything works well. When I try to execute it on OrientDB 2.1.16, everything is fine. The problem is only with driver 2.2 and OrientDB 2.2 (.4)

Regards
Jan

@wolf4ood
Copy link
Member

do you have an example script?

@janjilek
Copy link
Author

For query builder? It's really simple, only:

db
      .select('status')
      .from('Gift')
      .all()

Schema is also really simple:
field status of type number
and not unique index on status

@wolf4ood
Copy link
Member

can you post the schema also?

and some data thanks

@wolf4ood
Copy link
Member

wolf4ood commented Jul 12, 2016

Can you run this script against the Orientdb 2.2.4? with the default database?

const OrientJS = require('orientjs'),
    server = OrientJS({ host: 'localhost', port: 2424 }),
    db = server.use({ name: 'GratefulDeadConcerts', username: 'admin', password: 'admin' });

db.open().then(function(){

    db.select('name').from("OUSer").all().then(function(res){
        console.log(res);
        server.close();
    });

})

Thanks

@janjilek
Copy link
Author

Sure, I receive

[ { '@type': 'd',
    name: 'admin',
    '@rid': { [String: '#-2:0'] cluster: -2, position: 0 },
    '@version': 0 },
  { '@type': 'd',
    name: 'reader',
    '@rid': { [String: '#-2:1'] cluster: -2, position: 1 },
    '@version': 0 },
  { '@type': 'd',
    name: 'writer',
    '@rid': { [String: '#-2:2'] cluster: -2, position: 2 },
    '@version': 0 } ]

and I am using Orientdb 2.2.4 :-)

@wolf4ood
Copy link
Member

wolf4ood commented Jul 12, 2016

So the projections seems to work

if you can share your dataset i can inspect it further.

You can send me some example here e.risa@orientdb.com

Thanks

@janjilek
Copy link
Author

I just sent you dataset to your email.

Thanks

@wolf4ood
Copy link
Member

@janjilek

the problem is that you are using the decimal type that is not yet supported by the new native serializer/deserializer.
You should use the Double type

@janjilek
Copy link
Author

Ok, thank you, i will migrate it. But you should also add this restrictions to the documentation :-)

Jan

@janjilek
Copy link
Author

What is the best way to convert from Decimal to Double? Seems to be not possible to change it only in schema

@wolf4ood
Copy link
Member

wolf4ood commented Aug 1, 2016

hi @janjilek
it is fixed in the newer version 2.2.2 with decimal support.
Thanks

@wolf4ood wolf4ood closed this as completed Aug 1, 2016
@janjilek
Copy link
Author

janjilek commented Aug 1, 2016

Great!
Thank you

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

No branches or pull requests

4 participants