Sunday, 12 September 2021

ArangoDB: AQL: Read specific document by id or key

Syntax

RETURN DOCUMENT(collection_name, documentIdOrkey)

 

Example 1: Get the document by key

RETURN DOCUMENT ("users", "41308")

 

Above snippet return following response.

[
  {
    "_key": "41308",
    "_id": "users/41308",
    "_rev": "_cSAxcHm---",
    "id": 1,
    "firstName": "Krishna",
    "lastName": "Gurram"
  }
]

 

Example 2: Get the document by key

RETURN DOCUMENT ("users", "users/41308")

 

 

Previous                                                    Next                                                    Home

No comments:

Post a Comment