Tuesday, 3 August 2021

ArangoDB: Convert the cursor to array

toArray() method is used to get the information from cursor in array format.

127.0.0.1:8529@abc_org> usersCursor = userCollection.all()
SimpleQueryAll(user)

127.0.0.1:8529@abc_org> usersCursor.toArray()
[ 
  { 
    "_key" : "12977", 
    "_id" : "user/12977", 
    "_rev" : "_cRdSijO---", 
    "id" : 1, 
    "firstName" : "Ram" 
  }, 
  { 
    "_key" : "13028", 
    "_id" : "user/13028", 
    "_rev" : "_cRdT1TK---", 
    "id" : 514, 
    "firstName" : "Sailu" 
  }, 
  { 
    "_key" : "14390", 
    "_id" : "user/14390", 
    "_rev" : "_cRd12pm---", 
    "id" : 1, 
    "firstName" : "Ram" 
  }, 
  { 
    "_key" : "14434", 
    "_id" : "user/14434", 
    "_rev" : "_cRd5IAm---", 
    "lastName" : "Battu", 
    "firstName" : "Ram" 
  } 
]

 

 

 

Previous                                                    Next                                                    Home

No comments:

Post a Comment