Skip to content

Latest commit

 

History

History
112 lines (86 loc) · 2.09 KB

File metadata and controls

112 lines (86 loc) · 2.09 KB

Query and format output

curl -s -X GET "http://localhost:8000/items/1" | jq '.'

Search similar names

curl -X GET "http://localhost:8000/query_similar/name/john"

Search with limit

curl -X GET "http://localhost:8000/query_similar/city/new?limit=5"

Basic search

curl -X POST "http://localhost:8000/query_by_text"
-H "Content-Type: application/json"
-d '{ "conditions": { "name": "John" }, "case_sensitive": false }'

Complex search with multiple conditions (AND)

curl -X POST "http://localhost:8000/query_by_text"
-H "Content-Type: application/json"
-d '{ "conditions": { "city": "New York", "age": 25 }, "operator": "AND", "case_sensitive": false }'

Search with OR operator (not working)

curl -X POST "http://localhost:8000/query_by_text"
-H "Content-Type: application/json"
-d '{ "conditions": { "city": "New York", "city": "New Jersey" }, "operator": "OR", "case_sensitive": false }'

Search with limit

curl -X POST "http://localhost:8000/query_by_text?limit=5"
-H "Content-Type: application/json"
-d '{"conditions": {"city": "New York"}}'

Extract specific fields

curl -s -X GET "http://localhost:8000/items/1" | jq '.name, .age'

Filter query results

curl -s -X POST "http://localhost:8000/query_by_text" \
 -H "Content-Type: application/json" \
 -d '{
"conditions": {
"city": "New York"
}
}' | jq '.[] | select(.age >= 30)'

Create test record

curl -s -X POST "http://localhost:8000/items" \
  -H "Content-Type: application/json" \
  -d '{"name": "hello","age": 25,"city": "hello"}' | jq -r '.id'

4. Query similar

curl -s -X GET "http://localhost:8000/query_similar/name/bob" | jq '.'

5. Update record

curl -s -X PUT "http://localhost:8000/items/1" \
 -H "Content-Type: application/json" \
 -d '{"columns": {"age": 26}}' | jq '.'

6. Delete record

curl -s -X DELETE "http://localhost:8000/items" \
 -H "Content-Type: application/json" \
 -d "{\"ids\": [1]}" | jq '.'
curl -X DELETE "http://localhost:8000/items" \
  -H "Content-Type: application/json" \
  -d '{
    "ids": [2,3]
  }'