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

Is it possible to get records without meta-information? Exclude: @type, @version, etc... #6913

Closed
rcdiaz opened this issue Nov 15, 2016 · 7 comments
Assignees
Labels

Comments

@rcdiaz
Copy link

rcdiaz commented Nov 15, 2016

Can I get records without this parameters?

"@type": "d",
"@Rid": "#21:2",
"@Version": 1,
"@Class": "EHR",
notification": "Query executed in 0.066 sec. Returned 3 record(s)"

I have tried with:
select expand(@this.exclude('@type','@Rid','@Version','@Class')) from v

But only omits rid and class:

`select * from pueblo
{
"result": [
{
"@type": "d",
"@Rid": "#67:0",
"@Version": 1,
"@Class": "pueblo",
"name": "malagon"
},
{
"@type": "d",
"@Rid": "#68:0",
"@Version": 1,
"@Class": "pueblo",
"name": "pozuelo"
},
{
"@type": "d",
"@Rid": "#69:0",
"@Version": 1,
"@Class": "pueblo",
"name": "valenzuela"
}
],
"notification": "Query executed in 0.038 sec. Returned 3 record(s)"
}

select expand(@this.exclude('@type','@Rid','@Version','@Class')) from pueblo
{
"result": [
{
"@type": "d",
"@Version": 1,
"name": "malagon"
},
{
"@type": "d",
"@Version": 1,
"name": "pozuelo"
},
{
"@type": "d",
"@Version": 1,
"name": "valenzuela"
}
],
"notification": "Query executed in 0.039 sec. Returned 3 record(s)"
}`

@rcdiaz rcdiaz changed the title Is it possible to get records without meta-information? Is it possible to get records without meta-information? Exclude: @type, @version, etc... Nov 15, 2016
@lvca lvca added the question label Nov 15, 2016
@rcdiaz
Copy link
Author

rcdiaz commented Nov 17, 2016

help

@tglman
Copy link
Member

tglman commented Nov 17, 2016

hi @rcdiaz,

No is not possible to get out record without metadata, this are needed to reassociate the persistent data in case of update.

Bye

@StarpTech
Copy link

StarpTech commented Nov 17, 2016

HI @tglman for which case I need this metadata on client side and whats in the case of temporary rids? You don't need them for anywhere.

@tglman
Copy link
Member

tglman commented Nov 17, 2016

hi All,

Temporary rids are used in many places to reassociate references and define an unique identifier for each item of result of a projection query, as today the data structures of a projection query are the same of a persistent result set. This cannot be changed right now.

In any case we may evolve with new api that not require this in formation in case of projections, but nothing possible yet.

@rcdiaz
Copy link
Author

rcdiaz commented Nov 23, 2016

Hi @tglman

Would not it be possible to create this structure and retrieve
only the value field without meta information?

"@type": "d",
"@Rid": "#67:0",
"@Version": 1,
"@Class": "pueblo",
"value": {
"name" : "malagon",
"country": "Spain"
}

I am trying with the json function but I have the same problem:
it's adding metainformation so I'm not worth it, I have to retrieve the information as it is, but I've encapsulated it in the value property

select value from prueba
{"status":{"otherDetails":{"items":[{"items":[{"name":{"value":"Administrative Gender","class":"DV_TEXT"},"ehrId":"2d903575-be12-4334-b1dc-35e3126830ca"}

select value.toJson() from prueba
{"@type":"d","@version":0,"{"status":{"otherDetails":{"items":[{"items":[{"name":{"value":"Administrative Gender","class":"DV_TEXT"},"ehrId":"2d903575-be12-4334-b1dc-35e3126830ca"}

@tglman
Copy link
Member

tglman commented Apr 13, 2017

hi @rcdiaz,

The result set of a query in orient is a document, you cannot remove the metadata from it.

Regards

@luigidellaquila
Copy link
Member

Quick update on this, in V 3.0 projections won't have record metadata anymore. See http://orientdb.com/docs/3.0.x/sql/SQL-Projections.html

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

5 participants