dbusern
dbusern

Reputation: 315

How to define a schema full mode for a class in OrientDB

I am a new learner on OrientDB and have this question about schema. How to define a schema-full mode for a new class -say person class? Similarly how to define the schema-hybrid mode -using sql?

Somehow I can't make out this from the documentation.

Thanks, DBuserN

Upvotes: 2

Views: 301

Answers (2)

cheino
cheino

Reputation: 175

The schema-full mode is controlled on a per-class basis and can be enabled or disabled using the STRICTMODE keyword. For example:

alter class Person strictmode=true;

For reference http://orientdb.com/docs/2.0/orientdb.wiki/SQL-Alter-Class.html

Upvotes: 2

Oleksandr Gubchenko
Oleksandr Gubchenko

Reputation: 1369

  • Schema-full Enables strict-mode at a class-level and sets all fields as mandatory.
  • Schema-less Enables classes with no properties. Default is non-strict-mode, meaning that records can have arbitrary fields.
  • Schema-hybrid Enables classes with some fields, but allows records to define custom fields. This is also sometimes called schema-mixed.

You can define schema, as you create the structure of your DB. So if you define properties on a class it will be schema-full. A class without properties and it will be schema-less etc...

You can fine more information on official documentation.

Hope it helps.

Upvotes: 1

Related Questions