Basic Concepts

Documents

The basic unit of organization in Corona is a Document. Corona stores and searches documents. Corona supports documents encoded in JSON like

and XML like

We refer to this encoding, either JSON or XML, as the document's Type. The set of JSON keys, objects, and arrays, or XML elements and attributes you use in your documents is up to you. Corona does not require adherence to any schemas.

URIs

A document's URI is a key that you choose when you insert a document into the database. Each document has a unique URI. You use this URI to retrieve or refer to the document later. Corona requires that document URIs begin with a slash like /beer.

Beyond the URI, Corona maintains some additional metadata associated with each document including properties, permissions and quality.

Organization

How does Corona organize documents in the database? Logically, Corona provides two concepts: Collections and Directories. You can think of collections as unordered sets. If you have a notion of tag as well, that may help. Collections can hold multiple documents and documents can belong to multiple collections.

Directories are similar in concept to the notion of directories or folders in file systems. They are hierarchical and membership is implicit based on the path syntax of URIs.

 

API basics

Ok, so that's what is stored in Corona. What do the APIs look like? Corona endpoints are of the form:

http://host:port/service/path...

The part of the URL to left of the first single slash (http://host:port) will be given to you by your database administrator.

The service name starts the path and is indicative of what the service does. The part of the URL that follows (/path... above) is typically used to refer directly to a resource, typically a document URI, stored in Corona as well. And after that, many of the endpoints take additional query string variables.

Introducing Corona

CRUD APIs

Stack Overflow iconStack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.