Accessing specific documents with DP4


#1

Hello,

There seems to be lost capability in DP4 compared to DP3 when I attempt to access specific documents. With DP3, if I wanted to see all of the contents of one document I would do something like “SELECT * FROM default KEY ‘document_name’” or “SELECT * FROM default WHERE Meta().id=‘document_name’”. When I attempt these commands now I get:

“errors”: [
{
“code”: 5000,
“msg”: “syntax error”
}
]

with "SELECT * FROM default KEY ‘document_name’

and:

“errors”: [
{
“code”: 5000,
“msg”: “Wrong number of arguments to function Meta.”
}
]

with “SELECT * FROM default WHERE Meta().id=‘document_name’”.

Is there another way I would need to go about doing this now or is this something that is being worked out.

I noticed in the new language reference that the Meta() function now seems to expect an expression in the parentheses as the name of the document. I also tried using Meta(‘document_name’).id=‘document_name’, which returns an empty result set.


#2

"SELECT * FROM default USE KEYS ‘document_name’


#3

For the query using Meta() :

select * from default where meta(default).id = ‘document_name’

As an example :
select * from purchases where meta(purchases).id = ‘purchase1’


#4

Or with aliases:

select * from purchases p where meta§.id = “purchase1”


#5

Thank you. Those cleared it up perfectly. Just poor syntax on my part.