David, Absolutely yes (Take a look at: http://www.orientechnologies.com/docs/1.7.8/orientdb.wiki/Graph-Schema.html). Have you created the property as mandatory but have you checked the "not-null" setting?
Try to execute these commands: ALTER PROPERTY User.lastLogin MANDATORY TRUE ALTER PROPERTY User.lastLogin NOTNULL FALSE Lvc@ On 19 August 2014 21:12, David J Lima <[email protected]> wrote: > Is it possible to have a field in a vertex be a *mandatory,* datetime > type, but also be allowed to be null? > Studio let's me set the schema that way. > > For example when creating a new user, I want a field called lastLogin, but > as it's a new user, there is no datetime to place there yet. Orient > complains: > db.vertex.create({ > '@class' : 'NewUser' > }); > > error (of course) because lastLogin field is mandatory, but trying: > > db.vertex.create({ > '@class' : 'User', > lastLogin: null > }); > > db.vertex.create({ > '@class' : 'User', > lastLogin : '' > }); > > db.vertex.create({ > '@class' : 'User', > lastLogin: 'NULL' > }); > > All cause an error too > > -- > > --- > You received this message because you are subscribed to the Google Groups > "OrientDB" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > For more options, visit https://groups.google.com/d/optout. > -- --- You received this message because you are subscribed to the Google Groups "OrientDB" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
