orientechnologies / orientjs

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

session.index.create fails with engine #420

Closed Aeonrush closed 4 years ago

Aeonrush commented 4 years ago

Hi OrientDB Docker image tag: 3.0.25 Orientjs: 3.0.8

Maybe I doing something wrong. I get session from sessions pool

Example

const session = await pool.acquire();
session.index.create({
  name: 'User._username_displayName',
  class: 'User',
  type: 'FULLTEXT',
  engine: 'LUCENE',
  properties: ['username', 'displayName'],
  ifnotexist: true
});

Throws an Error

TypeError: Cannot read property 'escape' of undefined
    at ODatabaseSession.create (/var/www/project/node_modules/orientjs/lib/client/database/idx/index.js:207:35)
    at ODatabaseSession.session.index.get.catch (/var/www/project/src/provider/orientdb/User/UserProvider.js:110:32)

idx/index.js:207:35 has

if (config.engine) {
  query += " ENGINE " + this.db.escape(config.engine);
}

Thanks Best regards