orientechnologies / orientjs

The official fast, lightweight node.js client for OrientDB
http://orientdb.com
Other
326 stars 68 forks source link

Error creating a mandatory not null property #355

Closed creisle closed 5 years ago

creisle commented 5 years ago

orientjs version: 3.0.2 orientdb version: 3.0.6

I am running into an error creating non-null properties.

TypeError: (intermediate value)(intermediate value)(intermediate value).all is not a function

I think this may be a typo in the property creation logic /orientjs/lib/client/database/class/property.js

line 202 seems to have the all not on the db command like the other property statements

if (property.notNull !== undefined) {
    promises.push(
      this.db.command(
        prefix + "NOTNULL " + (property.notNull ? "true" : "false").all()
      )
    );
  }

whereas I would have expected

if (property.notNull !== undefined) {
    promises.push(
      this.db.command(
        prefix + "NOTNULL " + (property.notNull ? "true" : "false")
      ).all()
    );
  }
wolf4ood commented 5 years ago

Hi @creisle

thanks for raising this issue. Indeed there was a typo. Fixed and pushed. It will be available in the next OrientJS 3.0.3 release

wolf4ood commented 5 years ago

Hi @creisle

we have just release OrientJS 3.0.3 with the fix. Thanks