/// <summary> /// Find the document of an entity by entity id /// </summary> internal JsonObject FindDocument(string entityId) { try { var id = DocumentId.Parse(entityId); id.ThrowIfHasNull(); return(arango.ExecuteAqlQuery(new AqlQuery() .Return(() => AF.Document(id.Collection, id.Key)) ).First().AsJsonObject); } catch (ArangoException e) when(e.ErrorNumber == 1203) { // collection or view not found return(null); } }
public JsonObject Load(string sessionId) { try { JsonObject document = arango.ExecuteAqlQuery( new AqlQuery() .Return(() => AF.Document(CollectionName, sessionId)) ).First().AsJsonObject; return(document?["sessionData"].AsJsonObject ?? new JsonObject()); } catch (ArangoException e) when(e.ErrorNumber == 1203) { // collection or view not found return(new JsonObject()); } }