Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我在 couchdb 的关键字段中有一个键。我的密钥因每个文档而异。我需要获取各种键的文档:说第一个键是“123123”,第二个键是“234234”,我必须在一个查询中传递这些并使用 curl 命令获取两个键的结果。
在 SQL 中,我们可以这样做:
select * from table where user_id in "123123,234234";
同样,我需要使用 curl 在 couchdb 中执行此操作。这可以使用 curl 命令吗?
提前致谢。
是的:
curl -X POST http://localhost:5984/mydb/_design/users/_view/by_user_id -d '{"keys": ["123123", "234234"]}' -H "Content-Type: application/json"
有关 CouchDB 视图查询选项的更多信息