Skip to content

Composables ​

All composables are auto-imported.

ComposablePurpose
useMongocampAdminUser and role CRUD
useMongocampCollectionReactive state for paginated collection queries
useMongocampDocumentDocument-level helpers (metadata stamping, partial updates)
useMongocampSchemaInfers a schema from sampled documents; generates a matching TS interface
useMongocampBucketGridFS bucket detection, file-id resolution, upload (also uploadFiles)/download/fetchFileBlob
useMongocampIndexCreate/list/delete MongoDB indexes (standard, unique, text, expiring)
useMongocampJobsList/register/update/execute/delete scheduled background jobs
useMongocampAccountAccount self-service: profile, password change, API key regeneration
useMongocampSystemRead-only database viewer (list, per-database info, collections), cluster members and masked server settings
useMongocampExportrowsToCsv and downloadTextFile for exporting rows already on screen
useMongocampFilterBuilderTurns filter rows (field, operator, value) into one Lucene query; type-aware operators, injection-safe
useMongocampAdminGateblocked / message for components that need an administrator: show "administrators only" without a request
useMongocampFieldTypesfield paths with the types of their values for a collection (fields/detail, cached): filter fields, write hints
useMongocampBulkByFiltercountDocuments / deleteByFilter / updateByFilter: one request each by the Lucene filter of the list
useMongocampBulkDeleterunBulkDelete: delete many items with limited concurrency (or one request per chunk) and a per-item failure report
useMongocampImportimportRows: insert documents in batches with a per-batch failure report
useMongocampAggregationrunAggregation (server-side paging, deny-listed stages refused), listDistinct, sampleDocuments, readable aggregation errors
useMongocampErrorMaps API errors (network / 401 / 403 / other) to readable messages
useMongocampQueryHigh-level Lucene query helpers (equals, like, inRange, and, or, …)
useMongocampQueryBuilderLow-level Lucene syntax builder used by useMongocampQuery
useMongocampExtendedJsonConverts MongoDB extended-JSON documents to/from the plain values FUAutoForm binds to
useMongocampConnectionCan the server be reached? online / offline / unreachable, check(), report(error); kept current with the offline option
useMongocampSessionIs the login still usable? Token-expiry check (no request), optional server check (verify), invalidateSession
useMongocampRolesRole/route-pattern access checks (isAdmin, isManager, canSeeAdmin, canSeeManagement, isAllowedPathForRoute); powers the global nav guard
useMongocampCollectionNamesThe collection names, loaded once and shared (sidebar, switcher, panel), split into collections / buckets / mc_*
useMongocampNavigationThe module's pages as role-aware, translated navigation data (groups, and menu for UNavigationMenu)
useMongocampBreadcrumbsThe breadcrumb of the current route among the module's pages
useMongocampPathsThe base routes of the app's MongoCamp pages (module option paths) — what the components' *Path props fall back to
useMongocampProxyModetrue in server proxy mode (no login, the api key decides)
useMongocampPermissionsMay the user read / write / administer a collection? From GET /auth/permissions (never from the session); UI-level gating that fails open
useMongocampFetchAllReads every page of a document or file list with a cap, progress and abort (fetchAllDocuments, fetchAllFiles)
useMongocampExportAllExports a whole collection or filter as JSON, NDJSON or CSV (cap, progress, abort; exact 64-bit integers)
useMongocampPersistedStateA ref remembered in localStorage (versioned, size-capped, never throws)
useMongocampSavedQueriesSaved filters and recent history per collection, browser-only, validated and capped; JSON export/import
useMongocampAutoRefreshInterval loads for live views: no overlap, backoff, pauses in a hidden tab, stops on unmount
useMongocampCollectionStatsTyped storage sizes and per-index usage ($indexStats, host stripped) of one collection
useMongocampCollectionCopyCopy a collection into a new one (copyCollection) and a timestamped quick backup (backupCollection)
useMongocampSavedPipelinesSaved aggregation pipelines per collection, browser-only, re-checked against the deny-list on every read
useMongocampServerOverviewDatabases, per-collection sizes (one request each, capped, progress), cluster and jobs in one call; parts fail independently
useMongocampClientApiMode-switching drop-in for useMongocampApi() — session or server proxy mode
useMongocampProxyApiThe server-proxy-mode branch useMongocampClientApi switches to

@sfxcode/nuxt-mongocamp-server additionally provides useMongocampApi() (raw API clients: adminApi, collectionApi, documentApi, fileApi, bucketApi, systemApi, …) and useMongocampAuth() (login, logout, isLoggedIn) — this module's composables are built on top of those.

Released under the MIT License.