Registry / devops / mongodb-ace-theme-query

mongodb-ace-theme-query

JSON →
library1.7.0jsnpmunverified

A custom ACE editor theme for MongoDB query bars used in Compass. Current stable version is 1.7.0, released sporadically alongside Compass updates. Provides syntax highlighting for MongoDB query syntax within ACE editors, designed to improve readability of queries. Differentiator: purpose-built for MongoDB's query language, used in official MongoDB Compass tools.

npm install mongodb-ace-theme-query
INSTALL
IMPORT
SIG · MONGODB-ACE-THEME-
M
mongodb-ace-theme-query
devopsjavascriptv1.7.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

(side-effect import)
import 'mongodb-ace-theme-query'; editor.setTheme('ace/theme/mongodb-query');
const theme = require('mongodb-ace-theme-query');
Package is a side-effect module; it registers itself with ACE/brace. Do not assign to a variable.

Registers the MongoDB query theme with ACE editor (via brace) and applies it to a new editor instance.

import 'mongodb-ace-theme-query'; import * as ace from 'brace'; const editor = ace.edit('editor'); editor.setTheme('ace/theme/mongodb-query'); editor.getSession().setMode('ace/mode/mongodb');
Debug
Known issues
breakingIn version 1.0.0, the import path changed from 'mongodb-ace-theme-query' to require registering via brace before import.
fix
Upgrade to version 1.0.0 or later; previously the theme was global.
affects: <1.0.0
gotchaThe package only registers a theme; you must have brace or ace installed separately.
fix
Install brace: npm install brace
affects: >=0.0.0
gotchaThe theme name must be 'ace/theme/mongodb-query' exactly. Misspelling or using 'mongodb-query' without the prefix will fail silently.
fix
Use the exact string 'ace/theme/mongodb-query'.
affects: >=0.0.0
Errors
Common errors & fixes
Error: Cannot find module 'mongodb-ace-theme-query'
Package not installed or missing from node_modules.
fix
Run npm install mongodb-ace-theme-query
TypeError: ace.edit is not a function
Brace or ace not installed or imported incorrectly.
fix
Install brace and import it: import * as ace from 'brace'
Theme 'ace/theme/mongodb-query' not found
Theme import order: the theme must be imported before setting it.
fix
Ensure import 'mongodb-ace-theme-query' appears before editor.setTheme()
Upgrade
Version history
1.7.0latest on npm
Audit
Dependencies
braceoptionalProvides ACE editor runtime; this theme is loaded via brace's theme registration.
Agent activity
4 hits · last 30 days
node
4
Resources
mongodb-ace-theme-query — npm install mongodb-ace-theme-query · libregistry