SODA Default Collection Metadata
on Autonomous Database 🔗
Describes the default collection metadata on Autonomous Database, that is the metadata for a
collection that is added when custom metadata is not supplied.
Each SODA implementation provides a way to create a default collection
when you supply a collection name. For example, in SODA for Java you use the
createCollection method and supply just a collection name
parameter:
db.admin().createCollection("myCol");
This creates a collection with default collection metadata. When you create a default
collection on your database, the collection metadata includes the following information
(regardless of which SODA implementation you use to create the default
collection):
SODA Customized Collection
Metadata on Autonomous Database 🔗
Describes SODA collection custom metadata on Autonomous Database.
Each SODA implementation provides a way to customize the collection
metadata during collection creation. For example, in SODA for Java, you can use the
following command:
OracleDocument metadata = db.createDocumentFromString("metadata_string");
OracleCollection col = db.admin().createCollection("myCustomColl", metadata);
In this example, for metadata_string you can use
the default metadata as the starting point, and customize the following:
Change keyColumn.assignmentMethod to
CLIENT: Change the value of the
assignmentMethod under keyColumn in
the metadata to CLIENT (instead of UUID).
Valid values for keyColumn.assignmentMethod on
Autonomous Database:
UUID (default): Keys are generated by SODA, based
on the UUID.
CLIENT: Keys are assigned by the client
application.
Provide a mediaTypeColumnname value: A media type column is needed if the collection
is to be heterogeneous, that is, it can store documents other than
JavaScript Object Notation (JSON). See Media Type Column Name for
details.
The following example specifies
client-assigned keys and a custom media type column. The
mediaTypeColumnname is specified with the value
YOUR_MEDIA_TYPE_COLUMN_NAME. Otherwise, the default settings are used.