Browse Source

ft: 代码调整

master
SisMaker 3 years ago
parent
commit
02e13c90c1
2 changed files with 21 additions and 9 deletions
  1. +4
    -0
      README.md
  2. +17
    -9
      src/agApi/agCollections.erl

+ 4
- 0
README.md View File

@ -42,4 +42,8 @@ Efficient, fast and easy to use.
%% Then you can then invoke various apis using poolName as the first argument
agMgrDb:curDbInfo(poolName).
# notice
该驱动中所有的字符串 一律值 二进制的字符串
QueryPars 和 Headers为map 其中的 key -> value 必须为字符串

+ 17
- 9
src/agApi/agCollections.erl View File

@ -181,7 +181,7 @@ collProps(PoolNameOrSocket, CollName) ->
%
% 400HTTP 400
% 404 HTTP 404
collCount(PoolNameOrSocket, CollName) ->
collCnt(PoolNameOrSocket, CollName) ->
Path = <<"/_api/collection/", CollName/binary, "/count">>,
agVstCli:callAgency(PoolNameOrSocket, ?AgGet, Path).
@ -189,20 +189,29 @@ collCount(PoolNameOrSocket, CollName) ->
% GET /_api/collection/{collection-name}/figures
% 3.4.0使ID访问集合
%
% collection-name
%
%
% details details为true将向数字返回扩展存储引擎特定的详细信息 ArangoDB
% details设置为false ArangoDB
% details可能会导致额外的负载
%
% HTTP 200
% count
% figures
% indexes
% count
% size
% figures
% indexes
% count
% size
% 400HTTP 400
% 404 HTTP 404
collFigures(PoolNameOrSocket, CollName) ->
Path = <<"/_api/collection/", CollName/binary, "/figures">>,
agVstCli:callAgency(PoolNameOrSocket, ?AgGet, Path).
collFigures(PoolNameOrSocket, CollName, QueryPars) ->
Path = <<"/_api/collection/", CollName/binary, "/figures">>,
agVstCli:callAgency(PoolNameOrSocket, ?AgGet, Path, QueryPars).
%
% PUT /_api/collection/{collection-name}/responsibleShard
%
@ -221,15 +230,14 @@ collFigures(PoolNameOrSocket, CollName) ->
% eg: MapData = #{'_key' => testkey, value => 23}
collResponsibleShard(PoolNameOrSocket, CollName, MapData) ->
Path = <<"/_api/collection/", CollName/binary, "/responsibleShard">>,
BodyStr = eVPack:encodeBin(MapData),
agVstCli:callAgency(PoolNameOrSocket, ?AgGet, Path, ?AgDefQuery, ?AgDefHeader, BodyStr).
agVstCli:callAgency(PoolNameOrSocket, ?AgPut, Path, ?AgDefQuery, ?AgDefHeader, eVPack:encodeBin(MapData)).
% ID
% GET /_api/collection/{collection-name}/shards
%
% collection-name
%
% true
% detailstrue
% ID的JSON数组
% details参数设置为trueID作为对象属性键的JSON对象
%

Loading…
Cancel
Save