Skip to main content

Get Records

Get Record by ID

GET /api/v1/records/:entityId

curl https://api.rushdb.com/api/v1/records/movie-123 \
-H "Authorization: Bearer $RUSHDB_API_KEY"

Search Records

POST /api/v1/records/search

curl -X POST https://api.rushdb.com/api/v1/records/search \
-H "Authorization: Bearer $RUSHDB_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"labels": ["MOVIE"],
"where": {"rating": {"$gte": 8}},
"orderBy": {"rating": "desc"},
"limit": 10
}'

Request body

FieldTypeDescription
labelsstring[]Filter by one or more labels
whereobjectField conditions and operators
orderByobject{"field": "asc" | "desc"}
limitnumberMax records. Omit when using select
skipnumberRecords to skip (pagination)
selectobjectOutput-shaping expressions (preferred)
groupBystring[]Group aggregated results

Relationship traversal

curl -X POST https://api.rushdb.com/api/v1/records/search \
-H "Authorization: Bearer $RUSHDB_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"labels": ["MOVIE"],
"where": {
"ACTOR": {
"$relation": {"type": "STARS_IN", "direction": "in"},
"country": "USA"
}
}
}'

Select Expressions

curl -X POST https://api.rushdb.com/api/v1/records/search \
-H "Authorization: Bearer $RUSHDB_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"labels": ["MOVIE"],
"select": {
"count": {"$count": "*"},
"avgRating": {"$avg": "$record.rating"}
}
}'
danger

Never set limit with select — it restricts the record scan and produces wrong totals.

GroupBy

curl -X POST https://api.rushdb.com/api/v1/records/search \
-H "Authorization: Bearer $RUSHDB_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"labels": ["MOVIE"],
"select": {
"count": {"$count": "*"},
"avgRating": {"$avg": "$record.rating"}
},
"groupBy": ["$record.genre"],
"orderBy": {"count": "desc"}
}'

Search Record Relationships

POST /api/v1/records/:entityId/search

Contextual search within a specific record's relationships:

curl -X POST https://api.rushdb.com/api/v1/records/movie-123/search \
-H "Authorization: Bearer $RUSHDB_API_KEY" \
-H "Content-Type: application/json" \
-d '{"labels": ["ACTOR"], "where": {"country": "USA"}}'