Wednesday 1 September 2021

ArangoDB: Get the type of collection

‘collection.type()’ method return an integer which specifies the type of collection.

 

Integer 2 specifies document collection and 3 specifies edge collection.

 

Let’s create document and edge collections.

127.0.0.1:8529@abc_org> db._createDocumentCollection("myDocCollection")
[ArangoCollection 34937, "myDocCollection" (type document, status loaded)]

127.0.0.1:8529@abc_org> db._createEdgeCollection("myEdgeCollection")
[ArangoCollection 34954, "myEdgeCollection" (type edge, status loaded)]

 

Let’s get the type of these collections.

127.0.0.1:8529@abc_org> db.myDocCollection.type()
2

127.0.0.1:8529@abc_org> db.myEdgeCollection.type()
3

 

 

 

Previous                                                    Next                                                    Home

No comments:

Post a Comment