获取CouchDB数据库中所有文档的字段名称

时间:2019-07-10 05:09:49

标签: couchdb couchapp

我想列出bedDB数据库中文档的字段名称。 我找到了curl命令,列出了ouchDB中数据库的文档及其数据。

这里是:

<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.0/jquery.min.js"></script>

<input type="text" name="newtask" value="" spellcheck="false" placeholder="New Task" id="newtask">
<ul id="tasksUL">
  <li>
  <input type="checkbox" id="newtaskitem0" name="done" class="right-margin">
  <input type='checkbox' id='delete${idx}' name="delete" value="newtaskitem0"><label>test</label><label for='delete${idx}' class="delete" title="Select item for removal">♻</label></li>
</ul>
<input type="button" value="Delete marked items" id="deleteItems">

在这里,我想要在文档中可用的列名列表。我搜索了但找不到将其列出的curl命令

这是我想要的输出:

paulsteven@smackcoders:~$ curl http://0.0.0.0:5984/first/_all_docs?include_docs=true

{"total_rows":3,"offset":0,"rows":[
{"id":"user1","key":"user1","value":{"rev":"1-d1846fad834a55aff582adc5a224684f"},"doc":{"_id":"user1","_rev":"1-d1846fad834a55aff582adc5a224684f","username":"syed","password":"syed123"}},
{"id":"user2","key":"user2","value":{"rev":"1-91bd89db90bbb0d731790707a6f4419e"},"doc":{"_id":"user2","_rev":"1-91bd89db90bbb0d731790707a6f4419e","username":"syed","password":"syed123","name":"syed"}},
{"id":"user3","key":"user3","value":{"rev":"2-bdb5b930eb5d3ee04e4371634e0a56e4"},"doc":{"_id":"user3","_rev":"2-bdb5b930eb5d3ee04e4371634e0a56e4","username":"steven","password":"steven123"}}
]}

请注意,在名为["id","_rev","username","password","name"] 的文档ID中,有一个名为user2的额外字段

要从长沙发数据库中获取此命令需要什么curl命令。为我提供一些解决方案。

0 个答案:

没有答案