Skip to content

docs: unify API query syntax with Spec canonical format#988

Merged
xuyushun441-sys merged 2 commits intomainfrom
copilot/refactor-query-syntax-docs
Mar 27, 2026
Merged

docs: unify API query syntax with Spec canonical format#988
xuyushun441-sys merged 2 commits intomainfrom
copilot/refactor-query-syntax-docs

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 27, 2026

Documentation for query syntax and IDataEngine contract diverged from the canonical @objectstack/spec schemas — using legacy filters/tuple/sort/group_by/aggregate naming instead of the actual QuerySchema and EngineQueryOptionsSchema definitions.

query-syntax.mdx — full rewrite

  • All examples use where + $op object syntax, replacing tuple/三元组 format
  • sortorderBy, group_bygroupBy, aggregateaggregations array, expandRecord<string, QueryAST>
  • Interface definition matches actual QueryAST type
  • Added coverage for search, joins, windowFunctions, cursor, distinct

data-engine.mdx — full rewrite

  • Interface matches real IDataEngine: find/findOne/insert/update/delete/count/aggregate
  • Option types match canonical schemas (EngineQueryOptions, EngineUpdateOptions, etc.)
  • Documents optional capabilities: vectorFind, batch, execute

Legacy compatibility sections

Both docs now include explicit callouts: tuple/filters syntax is UI-builder input only — must be converted via parseFilterAST() before entering the protocol.

// Before (legacy — UI builder output only)
{ filters: [['status', '=', 'active'], ['amount', '>', 50000]], sort: [{ field: 'name', order: 'asc' }] }

// After (canonical — protocol format)
{ where: { status: 'active', amount: { $gt: 50000 } }, orderBy: [{ field: 'name', order: 'asc' }] }

💬 Send tasks to Copilot coding agent from Slack and Teams to turn conversations into code. Copilot posts an update in your thread when it's finished.

@vercel
Copy link
Copy Markdown

vercel bot commented Mar 27, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
objectstack-play Ready Ready Preview, Comment Mar 27, 2026 3:50am
spec Ready Ready Preview, Comment Mar 27, 2026 3:50am

Request Review

Rewrote query-syntax.mdx and data-engine.mdx to align all examples,
interface definitions, and field names with canonical QuerySchema,
FilterConditionSchema, and EngineQueryOptionsSchema from @objectstack/spec.

- where + MongoDB-style $op object syntax (replaces filters/tuple/三元组)
- orderBy (replaces sort), groupBy (replaces group_by)
- aggregations array (replaces aggregate object map)
- expand as Record<string, QueryAST> (replaces string array)
- IDataEngine contract matches real interface (find/findOne/insert/update/delete/count/aggregate)
- Added legacy compatibility sections with migration guidance
- Updated CHANGELOG.md

Agent-Logs-Url: https://github.com/objectstack-ai/spec/sessions/fc216716-2629-4ab4-821b-479aa8d48b3f

Co-authored-by: xuyushun441-sys <255036401+xuyushun441-sys@users.noreply.github.com>
Copilot AI changed the title [WIP] Update API query syntax documentation to align with Spec standards docs: unify API query syntax with Spec canonical format Mar 27, 2026
Copilot AI requested a review from xuyushun441-sys March 27, 2026 03:50
@xuyushun441-sys xuyushun441-sys marked this pull request as ready for review March 27, 2026 03:53
@xuyushun441-sys xuyushun441-sys merged commit 925ca06 into main Mar 27, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants