Skip to content

Commit

Permalink
Merge pull request #191 from zankia/experimental
Browse files Browse the repository at this point in the history
.gitignore added to repo, graph operation added to cli
  • Loading branch information
remyla committed May 22, 2017
2 parents 276e94a + b7b0c27 commit 2ed8b68
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
3 changes: 3 additions & 0 deletions .gitignore
@@ -0,0 +1,3 @@
node_modules/
conf.json
*.pem
12 changes: 6 additions & 6 deletions cli/damas.sh
Expand Up @@ -72,11 +72,6 @@ run() {
map_server_errors "${RES##*$'\n'}"
}

damas_search_mongo() {
RES=$(curl $CURL_ARGS $AUTH ${URL}search_mongo/ \
-d '{"query": "'$1'", "sort": "'$2'", "limit": "'$3'", "skip": "'$4'"}')
}

get_ids() {
if [ $# -eq 0 ]; then
echo "damas: missing file argument"
Expand Down Expand Up @@ -139,6 +134,7 @@ show_help_msg() {
echo " update <json> update nodes"
echo " upsert <json> create or update nodes"
echo " delete <json> delete nodes"
echo " graph <json> read all related nodes"
echo " search <query> search"
echo " search_mongo <query> <sort> <limit> <skip> MongoDB search - beta"
echo " comment <json> create child node"
Expand Down Expand Up @@ -244,6 +240,9 @@ case $COMMAND in
delete)
run "curl $CURL_ARGS $AUTH -X DELETE -d '$*' ${URL}delete/"
;;
graph)
run "curl $CURL_ARGS $AUTH -d '$*' ${URL}graph/0/"
;;
search)
run "curl $CURL_ARGS $AUTH ${URL}search/$1"
;;
Expand Down Expand Up @@ -288,7 +287,8 @@ case $COMMAND in
run "curl $CURL_ARGS $AUTH -X DELETE -d '$IDS' ${URL}delete/"
;;
search_mongo)
damas_search_mongo $@
QUERY='{"query": '$1', "sort": '$2', "limit": '$3', "skip": '$4'}'
run "curl $CURL_ARGS $AUTH -X POST ${URL}search_mongo/ -d '$QUERY'"
;;
lock)
get_ids $@
Expand Down

0 comments on commit 2ed8b68

Please sign in to comment.