undefiened field in schema-full mode

90 views
Skip to first unread message

Yuri Makhno

unread,
Jan 16, 2012, 11:12:49 AM1/16/12
to OrientDB
Hi,

Is it possible to restrict adding document that has field which is
undefined in the schema?

Hor example if schema has class: TestClass(a : String, b : String), I
shouldn't be able to add following document: { "@class" : "TestClass",
"a" : "a", "c" : "c", "b" : "b" } because it has "c" field, but
propery "c" is undefined in the schema.
If yes, how can I turn on such validation?

Regards,
Yuri

Luca Garulli

unread,
Jan 19, 2012, 2:37:46 PM1/19/12
to orient-...@googlegroups.com
Hi,
this is really needed to get working as schema-full-strict mode.

I think it could be implemented like:

OClass.setStrict( boolean )

Setting to true a check is made, otherwise works like now.

Can you add a new issue for this?

Lvc@

Anton Terekhov

unread,
Jan 20, 2012, 6:47:34 AM1/20/12
to orient-...@googlegroups.com
Luca, is it'll be possible to use strict mode via binary?

Anton Terekhov

unread,
Jan 20, 2012, 6:50:38 AM1/20/12
to orient-...@googlegroups.com

Luca Garulli

unread,
Jan 20, 2012, 6:50:16 AM1/20/12
to orient-...@googlegroups.com
Hi,
course it will work.

By the way have you a better name for it?

OClass.setStrict( boolean ) - default FALSE
OClass.allowAdditionalFields( boolean ) - default TRUE


Lvc@

Anton Terekhov

unread,
Jan 20, 2012, 9:21:22 AM1/20/12
to orient-...@googlegroups.com
Luca, these functions are per class on client or per class on server ( also saved in schema)?

Yuri Makhno

unread,
Jan 20, 2012, 10:29:18 AM1/20/12
to OrientDB
Hi,

Thanks for the answer!

I've created new feature request: http://code.google.com/p/orient/issues/detail?id=684

On 19 янв, 21:37, Luca Garulli <l.garu...@gmail.com> wrote:
> Hi,
> this is really needed to get working as schema-full-strict mode.
>
> I think it could be implemented like:
>
> OClass.setStrict( boolean )
>
> Setting to true a check is made, otherwise works like now.
>
> Can you add a new issue for this?
>
> Lvc@
>

Luca Garulli

unread,
Jan 20, 2012, 10:44:36 AM1/20/12
to orient-...@googlegroups.com
Hi Anton,
what you mean?

Lvc@

Anton Terekhov

unread,
Jan 20, 2012, 12:02:46 PM1/20/12
to orient-...@googlegroups.com
Luca, hi.

I just mean can two clients (first with OClass.setStrict(true) second with OClass.setStrict(false)) both communicate to same class on same DB?

Luca Garulli

unread,
Jan 20, 2012, 12:52:50 PM1/20/12
to orient-...@googlegroups.com
The class is set at server side, so if a client change the setting with:

ALTER CLASS Employee STRICTMODE true

all the client updates/saves will be validated against the new settings.

Lvc@

Luca Garulli

unread,
Jan 22, 2012, 10:22:53 AM1/22/12
to orient-...@googlegroups.com
Fixed issue 684 in SVN r4636.

Use OClass.setStrictMode(boolean)

or

ALTER CLASS Employee STRICTMODE true

Lvc@
Reply all
Reply to author
Forward
0 new messages