-
Notifications
You must be signed in to change notification settings - Fork 288
Add DB operators docs #2538
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 DB operators docs #2538
Conversation
WalkthroughAdds a new documentation page at src/routes/docs/products/databases/db-operators/+page.markdoc documenting database operators (atomic per-field updates, multi-field transactional updates, operator categories, and JavaScript/Dart examples). Updates src/routes/docs/products/databases/+layout.svelte to insert a "Database operators" navigation item with href /docs/products/databases/db-operators and a badge valid until 31 Dec 2025, placed after the "CSV imports" entry. No runtime logic or exported API changes. Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes
Pre-merge checks and finishing touches✅ Passed checks (2 passed)
✨ Finishing touches🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
♻️ Duplicate comments (1)
src/routes/docs/products/databases/db-operators/+page.markdoc (1)
57-80: Same issue as JavaScript example.The Dart example has the same problems:
- Line 75 shows the full array
['a', 'b', 'c']instead of just the value(s) to append- Line 76's comment about the field being optional is misleading for
arrayAppend
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
src/routes/docs/products/databases/+layout.svelte(1 hunks)src/routes/docs/products/databases/db-operators/+page.markdoc(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
- GitHub Check: build
- GitHub Check: format
- GitHub Check: tests
🔇 Additional comments (2)
src/routes/docs/products/databases/+layout.svelte (1)
108-113: LGTM! Navigation item properly structured.The new "Database operators" navigation item is correctly placed in the Journeys section with appropriate formatting and badge expiration date.
src/routes/docs/products/databases/db-operators/+page.markdoc (1)
1-13: LGTM! Well-structured introduction.The frontmatter and introduction clearly communicate the purpose and benefits of database operators.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
♻️ Duplicate comments (1)
src/routes/docs/products/databases/db-operators/+page.markdoc (1)
52-74: Fix the Dart example to reflect TablesDB operators.This block still wires up
Databases.createOperations, feeds the full post-append array, and labels thedatapayload as optional. That contradicts the text above and Appwrite’s TablesDB samples, where rows are updated viaTablesDBwith operator helpers that carry only the value to append (and the payload is required). Please switch the example toTablesDB, show the operator call indata, and drop the “optional” wording so the Dart snippet mirrors the JS version and the actual SDK shapes. (appwrite.io) Based on learnings
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
src/routes/docs/products/databases/db-operators/+page.markdoc(1 hunks)
🧰 Additional context used
🧠 Learnings (3)
📚 Learning: 2025-09-05T19:35:04.162Z
Learnt from: ebenezerdon
Repo: appwrite/website PR: 2372
File: src/routes/docs/tutorials/nuxt/step-6/+page.markdoc:79-83
Timestamp: 2025-09-05T19:35:04.162Z
Learning: In Nuxt tutorial files, the correct Appwrite database instance to use is `tablesDB` (imported from "~/appwrite"), not `database`. All tablesDB method calls should use the object parameter format: listRows({ databaseId, tableId, queries }), createRow({ databaseId, tableId, rowId, data }), and deleteRow({ databaseId, tableId, rowId }).
Applied to files:
src/routes/docs/products/databases/db-operators/+page.markdoc
📚 Learning: 2025-09-05T19:35:59.449Z
Learnt from: ebenezerdon
Repo: appwrite/website PR: 2372
File: src/routes/docs/tutorials/react-native/step-6/+page.markdoc:67-73
Timestamp: 2025-09-05T19:35:59.449Z
Learning: In React Native tutorials, the lib/appwrite.js file exports `tablesDB` (not `databases`), so imports should use `import { tablesDB } from "../lib/appwrite"` to match the export pattern established in step-3.
Applied to files:
src/routes/docs/products/databases/db-operators/+page.markdoc
📚 Learning: 2025-09-05T19:35:53.943Z
Learnt from: ebenezerdon
Repo: appwrite/website PR: 2372
File: src/routes/docs/tutorials/react/step-6/+page.markdoc:70-75
Timestamp: 2025-09-05T19:35:53.943Z
Learning: In React tutorial files, the correct Appwrite database instance to import is `tablesDB` from "../appwrite", not `databases`. The import statement should be `import { tablesDB } from "../appwrite"` to match the usage throughout the React tutorial code.
Applied to files:
src/routes/docs/products/databases/db-operators/+page.markdoc
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
- GitHub Check: build
- GitHub Check: tests
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🧹 Nitpick comments (1)
src/routes/docs/products/databases/db-operators/+page.markdoc (1)
93-93: Consider clarifying or demonstrating optional parameters.Several numeric operator descriptions mention optional behavior (e.g., "Optionally cap the result at a maximum value"), but the examples show only single-parameter calls. If these operators accept additional parameters for capping/limiting, consider either:
- Showing an example:
Operator.increment(1, { max: 100 })- Or removing "Optionally" to avoid implying unavailable functionality
Also applies to: 106-106, 119-119, 132-132, 158-158
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
src/routes/docs/products/databases/db-operators/+page.markdoc(1 hunks)
🧰 Additional context used
🧠 Learnings (3)
📚 Learning: 2025-09-05T19:35:04.162Z
Learnt from: ebenezerdon
Repo: appwrite/website PR: 2372
File: src/routes/docs/tutorials/nuxt/step-6/+page.markdoc:79-83
Timestamp: 2025-09-05T19:35:04.162Z
Learning: In Nuxt tutorial files, the correct Appwrite database instance to use is `tablesDB` (imported from "~/appwrite"), not `database`. All tablesDB method calls should use the object parameter format: listRows({ databaseId, tableId, queries }), createRow({ databaseId, tableId, rowId, data }), and deleteRow({ databaseId, tableId, rowId }).
Applied to files:
src/routes/docs/products/databases/db-operators/+page.markdoc
📚 Learning: 2025-09-05T19:35:59.449Z
Learnt from: ebenezerdon
Repo: appwrite/website PR: 2372
File: src/routes/docs/tutorials/react-native/step-6/+page.markdoc:67-73
Timestamp: 2025-09-05T19:35:59.449Z
Learning: In React Native tutorials, the lib/appwrite.js file exports `tablesDB` (not `databases`), so imports should use `import { tablesDB } from "../lib/appwrite"` to match the export pattern established in step-3.
Applied to files:
src/routes/docs/products/databases/db-operators/+page.markdoc
📚 Learning: 2025-09-05T19:35:53.943Z
Learnt from: ebenezerdon
Repo: appwrite/website PR: 2372
File: src/routes/docs/tutorials/react/step-6/+page.markdoc:70-75
Timestamp: 2025-09-05T19:35:53.943Z
Learning: In React tutorial files, the correct Appwrite database instance to import is `tablesDB` from "../appwrite", not `databases`. The import statement should be `import { tablesDB } from "../appwrite"` to match the usage throughout the React tutorial code.
Applied to files:
src/routes/docs/products/databases/db-operators/+page.markdoc
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
- GitHub Check: build
- GitHub Check: tests
🔇 Additional comments (3)
src/routes/docs/products/databases/db-operators/+page.markdoc (3)
32-49: LGTM! Example addresses previous feedback correctly.The JavaScript example now:
- Imports
Operatorfrom "appwrite" (addressing previous missing import concern)- Uses
tablesDBconsistently with the codebase pattern- Shows
Operator.arrayAppend(['c'])correctly passing only the value to append, not the full resulting array
51-68: LGTM! Dart example is correct and consistent.The Dart example properly demonstrates the operator pattern with:
- Correct import statement
TablesDBinstance usage- Proper
Operator.arrayAppend(['c'])syntax matching the JavaScript example
337-348: LGTM! Date operator naming is correct.The
dateSetNowoperator is correctly named (addressing the previous typo concern about "dateSetNo"). The implementation and examples look good.
| Operator.arrayFilter(Condition.GreaterThan, 10) | ||
| ``` | ||
| ```dart | ||
| Operator.arrayFilter(Condition.GreaterThan, 10) | ||
| ``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add import and explanation for Condition enum.
The arrayFilter example references Condition.GreaterThan, but Condition is never imported or explained. Users copying this code will encounter a ReferenceError.
Update the documentation to either:
- Add
Conditionto the import example at the top (lines 33, 52) - Or include a standalone import example in this section showing:
import { Condition } from "appwrite" - And briefly explain what
Conditionvalues are available (e.g.,GreaterThan,LessThan,Equals, etc.)
🤖 Prompt for AI Agents
In src/routes/docs/products/databases/db-operators/+page.markdoc around lines
270 to 274, the example uses Condition.GreaterThan but Condition is never
imported or explained; update the docs to either add Condition to the existing
import examples at the top of the file (lines ~33 and ~52) or add a standalone
import near this example (e.g., import { Condition } from "appwrite"), and add
one short sentence listing the common Condition enum values (GreaterThan,
LessThan, Equals, etc.) so readers know what constants are available.
Co-authored-by: Aditya Oberai <adityaoberai1@gmail.com>
Co-authored-by: Aditya Oberai <adityaoberai1@gmail.com>
Co-authored-by: Aditya Oberai <adityaoberai1@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
♻️ Duplicate comments (1)
src/routes/docs/products/databases/db-operators/+page.markdoc (1)
794-824: Import and document theConditionenum for arrayFilter examples.All arrayFilter examples reference
Condition.GreaterThan, butConditionis never imported in any of the code examples throughout the page. Users copying these snippets will encounter aReferenceError.To fix this issue:
Add
Conditionto the imports at the top of the page (lines 33, 52, etc.):-import { Client, TablesDB, Operator } from "appwrite"; +import { Client, TablesDB, Operator, Condition } from "appwrite";Add a brief explanation near the arrayFilter section describing available Condition values (e.g.,
GreaterThan,LessThan,Equals,NotEquals, etc.) so developers know what constants are available.Alternatively, add a standalone import example in the arrayFilter section (lines 790-793) before the multicode block.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
src/routes/docs/products/databases/db-operators/+page.markdoc(1 hunks)
🧰 Additional context used
🧠 Learnings (3)
📚 Learning: 2025-09-05T19:35:04.162Z
Learnt from: ebenezerdon
Repo: appwrite/website PR: 2372
File: src/routes/docs/tutorials/nuxt/step-6/+page.markdoc:79-83
Timestamp: 2025-09-05T19:35:04.162Z
Learning: In Nuxt tutorial files, the correct Appwrite database instance to use is `tablesDB` (imported from "~/appwrite"), not `database`. All tablesDB method calls should use the object parameter format: listRows({ databaseId, tableId, queries }), createRow({ databaseId, tableId, rowId, data }), and deleteRow({ databaseId, tableId, rowId }).
Applied to files:
src/routes/docs/products/databases/db-operators/+page.markdoc
📚 Learning: 2025-09-05T19:35:59.449Z
Learnt from: ebenezerdon
Repo: appwrite/website PR: 2372
File: src/routes/docs/tutorials/react-native/step-6/+page.markdoc:67-73
Timestamp: 2025-09-05T19:35:59.449Z
Learning: In React Native tutorials, the lib/appwrite.js file exports `tablesDB` (not `databases`), so imports should use `import { tablesDB } from "../lib/appwrite"` to match the export pattern established in step-3.
Applied to files:
src/routes/docs/products/databases/db-operators/+page.markdoc
📚 Learning: 2025-09-05T19:35:53.943Z
Learnt from: ebenezerdon
Repo: appwrite/website PR: 2372
File: src/routes/docs/tutorials/react/step-6/+page.markdoc:70-75
Timestamp: 2025-09-05T19:35:53.943Z
Learning: In React tutorial files, the correct Appwrite database instance to import is `tablesDB` from "../appwrite", not `databases`. The import statement should be `import { tablesDB } from "../appwrite"` to match the usage throughout the React tutorial code.
Applied to files:
src/routes/docs/products/databases/db-operators/+page.markdoc
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
What does this PR do?
Adds DB operators docs
Test Plan
/docs/products/databases/db-operatorsRelated PRs and Issues
No
Have you read the Contributing Guidelines on issues?
Yes
Summary by CodeRabbit