Loading TOC...
Query Console User Guide (PDF)

MarkLogic 9 Product Documentation
Query Console User Guide
— Chapter 1

Introduction to Query Console

Query Console is an interactive web-based query development tool for writing and executing ad-hoc queries in XQuery, Server-Side JavaScript, SQL and SPARQL. Query Console enables you to quickly test code snippets, debug problems, profile queries, and run administrative XQuery scripts.

The following terms and definitions cover the primary Query Console components:

Term Definition
query Any executable block of XQuery, Server-Side JavaScript, SQL, or SPARQL. When you run a query in Query Console, you can view the results in your choice of formats.
workspace A collection of queries. Use workspaces to organize your queries. You can create multiple workspaces, but only one is active at a time.
history A record of previously executed versions of a query. Each time you execute a query in Query Console, the query text is saved in the history. Use the history to restore a query to a previous state.

Using Query Console, you can:

  • Create queries in JavaScript, XQuery, SQL, and SPARQL.
  • Create, modify, rename, and delete queries.
  • Run a query and view the output in multiple formats.
  • Profile query performance (XQuery and JavaScript only).
  • Explore and edit the contents of a database.
  • Create, delete, copy, rename, and reorganize workspaces to improve query organization.
  • Restore a query to a previous version from the saved history.
  • Export and import workspaces for easy sharing among users or across MarkLogic Server instances.

The query editor in Query Console includes features such as

  • Syntax coloring
  • Typeahead suggestions
  • Pop-up function reference documentation
  • Automatic closing and highlighting of quotes, parentheses, braces, and other grouping characters

The database explorer enables you to browse and edit the contents of a database. You can view document content and metadata, and insert, update, and delete content without writing any code.

The workspaces and queries created in Query Console are stored in MarkLogic Server, so they are available to you from any computer with access to your MarkLogic Server instance. For example, you can create workspaces and queries on your desktop computer and use them from a lab machine with access to the same MarkLogic Server instance.

You should only have one Query Console session active at a time for any given MarkLogic user. Query Console saves state to MarkLogic Server. If a user has multiple Query Console sessions active concurrently, the state can become inconsistent.

The picture below summarizes key Query Console UI features. For more information on using specific features, see the Query Console Walkthrough.

« Table of contents
Next chapter »