Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot delete instances where the primary key is a set #178

Open
arik-gamerlink opened this issue Oct 18, 2018 · 1 comment
Open

Cannot delete instances where the primary key is a set #178

arik-gamerlink opened this issue Oct 18, 2018 · 1 comment

Comments

@arik-gamerlink
Copy link

Hi, my table looks like the following

export default { fields: { ids: { type: 'frozen', typeDef: '<set<uuid>>', }, }, key: ['ids'],

When I fetch an instance using the ids set, and then attempt to delete it I get the following error

"ids cannot be restricted by more than one relation if it includes an Equal"
"code": 8704,
"query": "DELETE FROM "PrivateChat" WHERE "ids" = ? AND "ids" = ?;",

My guess is that CQL looks wrong

@arik-gamerlink
Copy link
Author

If anyone is looking for a workaround using raw query

const query =DELETE FROM "keyspace"."Table" WHERE "ids"={${firstId},${secondId}};

and then you use the execute_query method
https://express-cassandra.readthedocs.io/en/stable/notes/#raw-query

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant