小编Nav*_*dav的帖子

HTTP GET请求状态204 Vs 404

我有2个资源用户和相册.用户有一个专辑列表.要获得专辑,有2个REST API.

  1. user/{userId}/albums/{albumId}如果找不到,则按albumId获取相册返回404
  2. user/{userId}/albums通过userId获取所有相册.在这种情况下,如果用户没有相册,那么状态代码204或404是什么?

rest httpresponse http-status-code-404

16
推荐指数
5
解决办法
2万
查看次数

如果表具有SET类型列,则Cassandra IN查询无效

我是Cassandra的新手.我遇到了一个问题CQL IN query,如果表有SET类型列它可以工作.

CREATE TABLE test (
    test_date bigint, 
    test_id bigint, 
    caption text,
    PRIMARY KEY(test_date,test_id)
);

select * from test where test_date = 2022015 and test_id IN (1,2);
Run Code Online (Sandbox Code Playgroud)

但如果我添加上面设置的标签,那么它会给出错误

CREATE TABLE test1 (
    test_date bigint, 
    test_id bigint, 
    tags set<text>,
    caption text,
    PRIMARY KEY(test_date,test_id)
);

select * from test1 where test_date = 2022015 and test_id IN (1,2);
Run Code Online (Sandbox Code Playgroud)

code = 2200 [无效查询] message ="无法通过IN关系限制列"test_id",因为查询选择了一个集合"

cql cassandra

9
推荐指数
1
解决办法
2464
查看次数

从其他元素中删除一个Collection元素

嗨,我有两个SomeType a1,a2的集合,并希望从a1中删除a2的所有元素.

请建议我需要使用哪种类型的Collection:

  1. 数组列表
  2. 链表
  3. 其他 ?.

这有什么图书馆吗?

java collections data-structures

1
推荐指数
1
解决办法
69
查看次数