Tôi đang tạo api sẽ hoạt động trên cả hai mongo hoặc cassandra, vì lý do đó tôi đang sử dụng '_id' làm tên cột.Tên cột hợp lệ Cassandra
này phải là một tên hợp lệ theo các tài liệu:
Keyspace, column, and table names created using CQL can only contain alphanumeric and underscore characters. User-defined data type names and field names, user-defined function names, and user-defined aggregate names created using CQL can only contain alphanumeric and underscore characters. If you enter names for these objects using anything other than alphanumeric characters or underscores, Cassandra will issue an invalid syntax message and fail to create the object.
Tuy nhiên, khi tôi chạy tuyên bố này:
CREATE TABLE users(_id: bigint, entires: map<timestamp, text>, PRIMARY KEY(_id));
tôi trở lại các lỗi sau:
Invalid syntax at line 1, char 20
Có thể sử dụng dấu gạch dưới trong tên cột không?
mặc dù nó phải là bất hợp pháp theo tài liệu, nó thực sự hoạt động. xin vui lòng xem câu trả lời của tôi – kostja