This function creates a new relational schema in the Schema database.
The schema id is returned. Every SQL deployment must include a default
schema, called "main," as shown in the example below.
This schema is typically created for Range Views. However, such a schema can also
contain Template Views. Note that Range Views cannot be created in a schema
created by a Template View.
Parameters
schema-name
The schema name.
The schema name must be unique. A valid schema name is a single word that starts with an
alpha character. The schema name may contain numeric characters, but cannot contain
punctuation or special characters.
permissions
Permissions that control access to the schema.
If no permissions are specified, the default permissions are used.
When run in an XQuery context, the permissions are a sequence of
XML elements (sec:permission). When importing this module into
a Server-Side JavaScript context, the permissions are an array
of Objects.
Example
const view = require('/MarkLogic/views');
view.schemaCreate('main', [] );
// Create a new schema, named 'main', using the default permissions.
Stack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.
Stack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.