Friday 10 September 2021

ArangoDB: AQL: Insert multiple documents

 Syntax

FOR doc IN array_of_documents
    INSERT doc INTO colleciton_name

 

Example

let users_info = [
    {"id": 2, "firstName" : "Sowmya", "lastName" : "Gurram"},
    {"id" : 3, "firstName" : "Madhu", "lastName" : "Thatha"}
]

for doc in users_info
  INSERT doc INTO users

 

You can execute below snippet to get all the documents from a collection.

 

Syntax

FOR item in collection
  RETURN item

 

Example

FOR userDoc IN users
    RETURN userDoc

 

 


 

Previous                                                    Next                                                    Home

No comments:

Post a Comment