Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add equivalent SQL examples for admin API requests #1544

Open
JamesChenX opened this issue Aug 6, 2024 · 1 comment
Open

Add equivalent SQL examples for admin API requests #1544

JamesChenX opened this issue Aug 6, 2024 · 1 comment
Labels
documentation Improvements or additions to documentation

Comments

@JamesChenX
Copy link
Member

No description provided.

@JamesChenX JamesChenX added the documentation Improvements or additions to documentation label Aug 6, 2024
@JamesChenX
Copy link
Member Author

JamesChenX commented Aug 6, 2024

Movitation

All programmers should be familiar with the basic SQL statements, so it will be easier for users to understand the behavior of the new admin API after #1461.
e.g.:

POST /admins/query
{
  "skip": 20,
  "limit": 10,
  "projection": {
    "*": true
  },
  "filter": {
    "id": [1, 2, 3],
    "role": 1
  }
}

is equivalent to

select * from admins where id in (1, 2, 3) and role=1 limit 10 offset 20

Note that turms servers do NOT just send the SQL to MongoDB, but will run business logic before finding data in MongoDB. The SQL is just an example.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

1 participant