masumsoft / express-cassandra

Cassandra ORM/ODM/OGM for NodeJS with support for Apache Cassandra, ScyllaDB, Datastax Enterprise, Elassandra & JanusGraph.
http://express-cassandra.readthedocs.io
GNU Lesser General Public License v3.0
227 stars 67 forks source link

Unset primary key error thrown for non primary keys #221

Closed sajid9833 closed 4 years ago

sajid9833 commented 4 years ago

When table field name is sub string of primarykey field name and its not set then it's throwing unset primary key error.

consider table name is myinfo where firstname is primarykey and name is field of same table. Table myinfo : ( firstname text PRIMARY KEY, name text )

CASE 1 [Success] : input: { firstname: 'primarykeyFieldtext', name: 'github' } when both field firstname and name is set then query executed successfully

CASE 2 [ERROR] : input: { firstname: 'primarykeyFieldtext' } when name field is not set then its throwing "unset primary key" while its just a table field attribute , not a primary key. ERROR : apollo.model.save.unsetkey: Primary Key Field: name must have a value

NOTE: I tried express cassandra with lower version also, getting the same error.

cassandrSampleProject.zip

masumsoft commented 4 years ago

fixed in v2.4.0