orientjs icon indicating copy to clipboard operation
orientjs copied to clipboard

Not able to create property with name which only includes numbers (e.g. '1234')

Open aryanPatilhm2 opened this issue 4 years ago • 0 comments

Hi, I am trying to add one property under my class which includes only numbers e.g. '1234'. Whenever I fire request, it throws below error,

:"Error parsing query:\nCREATE PROPERTY myclass.1234 Linkset\n ^\nEncountered \" <FLOATING_POINT_LITERAL> \".1234 \"\" at line 1, column 23.\nWas expecting:\n \".\" ...\n \r\n\tDB name=\"MYDB\"\r\n\tError Code=\"1\"","errorStack":"OrientDB.RequestError: Error parsing query:\nCREATE PROPERTY myclass.1234 Linkset\n ^\nEncountered \" <FLOATING_POINT_LITERAL> \".1234 \"\" at line 1, column 23.\nWas expecting:\n \".\" ...\n \r\n\tDB name=\"MYDB\"\r\n\tError Code=\"1\"\n at child.Operation.parseError (/usr/src/app/node_modules/orientjs/lib/client/network/protocol37/operation.js:1247:13)\n at child.Operation.consume (/usr/src/app/node_modules/orientjs/lib/client/network/protocol37/operation.js:571:35)\n at ONetworkConnection.Connection.process (/usr/src/app/node_modules/orientjs/lib/client/network/conn.js:462:17)\n at ONetworkConnection.Connection.handleSocketData (/usr/src/app/node_modules/orientjs/lib/client/network/conn.js:344:20)\n at Socket.emit (events.js:315:20)\n at addChunk (internal/streams/readable.js:309:12)\n at readableAddChunk (internal/streams/readable.js:284:9)\n at Socket.Readable.push (internal/streams/readable.js:223:10)\n at TCP.onStreamRead (internal/stream_base_commons.js:188:23)"

I tried to create same property with orientdb-studio and it worked. So I checked the query that fired from browser which is like below,

CREATE PROPERTY `myclass`.`1234` LINKSET After that I checked in the orientjs modules code under path lib/client/database/class/property.js that on line 117, the logic is written such that it will generate the query like CREATE PROPERTY myclass.1234 LINKSET Can we have support for such property from module?

Thanks in advance ...

aryanPatilhm2 avatar Sep 02 '21 13:09 aryanPatilhm2