从命令行使用_find

温特迈耶

我的CouchDB(版本1.7.1_5)设置:

$ curl -X PUT http://127.0.0.1:5984/shop
$ curl -d "{\"type\": \"product\", \"name\": \"Apple\", \"price\": \"1\"}" \
  -X POST -H "Content-type: application/json" http://localhost:5984/shop/ 
{"ok":true,"id":"1ce330a867a803fd10082c451304075b",
"rev":"1-f61d5b64af58a6eda60ac0c9160ad690"}

现在我想找到名称为的产品Apple根据http://docs.couchdb.org/en/stable/api/database/find.html,我应该使用_find它。但是我找不到正确的语法。这个要求怎么了?

$ curl -d "{\"selector\": {\"name\": \"Apple\"}}" \
  -H "Content-Type: application/json" -X POST http://localhost:5984/shop/_find
{"error":"bad_request","reason":"Referer header required."}
埃里

芒果查询服务器,位于端点之后/{db}/_find,仅从2.0.0版本开始包含在CouchDB中

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章