Database Methods
Use MongoDB-backed helpers for user properties, collection queries, and application data.
User props
Simple per-user key/value storage:
Collections
Method reference
| Method | Signature | Returns |
|---|---|---|
setProp | setProp(uid, key, value) | void |
getProp | getProp(uid, key) | any |
findOne | findOne(col, query) | Document | null |
findAll | findAll(col, query) | Document[] |
updateOne | updateOne(col, filter, update) | UpdateResult |
Guidance
The legacy docs exposed both direct database methods and convenience helpers under db.operation. Use whichever version matches the task, but keep your schema and collection names consistent.
For simple per-user state, prefer helpers such as setProp, getProp, and incrementProp. For structured app data, work with explicit collections.
NxCreator handles the database connection layer for you. You write queries and updates, not connection management.
How did this page feel?
Quick feedback helps improve the docs.
Last updated March 22, 2026