| Modifier and Type | Class and Description |
|---|---|
| public static class | Schema.
Defines options to be passed to |
| public static class | Schema.
Defines options to be passed to |
| public static class | Schema.
Validation options to be passed to |
| Modifier and Type | Method and Description |
|---|---|
| public Collection | |
| public Collection | Returns: Collectioncollection name name, boolean true if allowed to reuse reuseExisting)Create a new collection if it does not already exist on the server. |
| public Collection | Returns: Collectioncollection name collectionName, Schema.reuseExisting, validation level and JSON schema options optionsCreate a new collection. |
| public void | dropCollection(String
name of collection to drop collectionName)Drop the collection from this schema. |
| public Collection | Returns: Collectioncollection name name)Retrieve a reference to the named collection. |
| public Collection | Returns: Collectioncollection name name, boolean true if required to exist requireExists)Retrieve a reference to the named collection hinting that an exception should be thrown if the collection is not known to the server. |
| public Table | Returns: Tablecollection name name)Retrieve a reference to the named collection using the table API. |
| public List | Returns: list ofCollection objectsRetrieve the set of collections existing in this schema. |
| public List | Returns: list ofCollection objectsmatch pattern pattern)Retrieve the set of collections existing in this schema and matching the given pattern. |
| public Table | |
| public Table | |
| public List | |
| public List | |
| public void | modifyCollection(String
collection name collectionName, Schema.validation level and JSON schema options optionsModify the schema validation of a collection. |
| createCollection | back to summary |
|---|---|
| public Collection createCollection(String name) Create a new collection.
| |
| createCollection | back to summary |
|---|---|
| public Collection createCollection(String name, boolean reuseExisting) Create a new collection if it does not already exist on the server.
| |
| createCollection | back to summary |
|---|---|
| public Collection createCollection(String collectionName, Schema. Create a new collection.
| |
| dropCollection | back to summary |
|---|---|
| public void dropCollection(String collectionName) Drop the collection from this schema.
| |
| getCollection | back to summary |
|---|---|
| public Collection getCollection(String name) Retrieve a reference to the named collection.
| |
| getCollection | back to summary |
|---|---|
| public Collection getCollection(String name, boolean requireExists) Retrieve a reference to the named collection hinting that an exception should be thrown if the collection is not known to the server.
| |
| getCollectionAsTable | back to summary |
|---|---|
| public Table getCollectionAsTable(String name) Retrieve a reference to the named collection using the table API. | |
| getCollections | back to summary |
|---|---|
| public List Retrieve the set of collections existing in this schema.
| |
| getCollections | back to summary |
|---|---|
| public List Retrieve the set of collections existing in this schema and matching the given pattern.
| |
| getTable | back to summary |
|---|---|
| public Table getTable(String name) Retrieve a reference to the named table. | |
| getTable | back to summary |
|---|---|
| public Table getTable(String tableName, boolean requireExists) Retrieve a reference to the named table hinting that an exception should be thrown if the collection is not known to the server. | |
| getTables | back to summary |
|---|---|
| public List Retrieve the set of tables existing in this schema. | |
| getTables | back to summary |
|---|---|
| public List Retrieve the set of tables existing in this schema and matching the given pattern. | |
| modifyCollection | back to summary |
|---|---|
| public void modifyCollection(String collectionName, Schema. Modify the schema validation of a collection.
| |
Schema#createCollection(String, CreateCollectionOptions).
Allowed options are:
Validation object
schema.createCollection(collName,
new CreateCollectionOptions().setReuseExisting(false)
.setValidation(new Validation().setLevel(ValidationLevel.STRICT)
.setSchema("{\"id\": \"http://json-schema.org/idx\", \"$schema\": \"http://json-schema.org/draft-06/schema#\","
+ "\"type\": \"object\", \"properties\": {\"index\": {\"type\": \"number\"}},\"required\": [\"index\"]}")));
schema.createCollection(collName, new CreateCollectionOptions().setReuseExisting(false).setValidation(new Validation().setLevel(ValidationLevel.OFF)));
schema.createCollection(collName,
new CreateCollectionOptions().setReuseExisting(true);
| Modifier and Type | Field and Description |
|---|---|
| private Boolean | |
| private Schema. |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public Boolean | |
| public Schema. | |
| public Schema. | |
| public Schema. |
| reuseExisting | back to summary |
|---|---|
| private Boolean reuseExisting | |
| validation | back to summary |
|---|---|
| private Schema. | |
| CreateCollectionOptions | back to summary |
|---|---|
| public CreateCollectionOptions() | |
| getReuseExisting | back to summary |
|---|---|
| public Boolean getReuseExisting() | |
| getValidation | back to summary |
|---|---|
| public Schema. | |
| setReuseExisting | back to summary |
|---|---|
| public Schema. | |
| setValidation | back to summary |
|---|---|
| public Schema. | |
Schema#modifyCollection(String, ModifyCollectionOptions). Options are defined by Validation object.
Example:
schema.modifyCollection(collName1, new ModifyCollectionOptions().setValidation(new Validation().setLevel(ValidationLevel.OFF)));
| Modifier and Type | Field and Description |
|---|---|
| private Schema. |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public Schema. | |
| public Schema. |
| validation | back to summary |
|---|---|
| private Schema. | |
| ModifyCollectionOptions | back to summary |
|---|---|
| public ModifyCollectionOptions() | |
| getValidation | back to summary |
|---|---|
| public Schema. | |
| setValidation | back to summary |
|---|---|
| public Schema. | |
Schema#createCollection(String, CreateCollectionOptions) or
Schema#modifyCollection(String, ModifyCollectionOptions).
Allowed options are:
ValidationLevel
| Modifier and Type | Class and Description |
|---|---|
| public static enum | Schema.
Defines how validation options are applied. |
| Modifier and Type | Field and Description |
|---|---|
| private Schema. | |
| private String |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public Schema. | |
| public String | |
| public Schema. | |
| public Schema. |
| level | back to summary |
|---|---|
| private Schema. | |
| schema | back to summary |
|---|---|
| private String schema | |
| Validation | back to summary |
|---|---|
| public Validation() | |
| getLevel | back to summary |
|---|---|
| public Schema. | |
| getSchema | back to summary |
|---|---|
| public String getSchema() | |
| setLevel | back to summary |
|---|---|
| public Schema. | |
| setSchema | back to summary |
|---|---|
| public Schema. | |
| Modifier and Type | Field and Description |
|---|---|
| public static final Schema. | |
| public static final Schema. |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public static Schema. | |
| public static Schema. |
| OFF | back to summary |
|---|---|
| public static final Schema. | |
| STRICT | back to summary |
|---|---|
| public static final Schema. | |
| ValidationLevel | back to summary |
|---|---|
| private ValidationLevel() | |
| valueOf | back to summary |
|---|---|
| public static Schema. | |
| values | back to summary |
|---|---|
| public static Schema. | |