2
從Marklogic數據庫獲取數據,但代碼僅搜索一個文件。有沒有其他辦法可以達到目標MarkLogic/Python查詢只搜索一個文件
import `http`.`client`
`conn` = `http`.`client`.`HTTPConnection`("127.0.0.1:8040")
headers = {
'authorization': "Digest `username`=\"root\", realm=\"public\", nonce=\"\", `uri`=\"/v1/documents?`uri`=/scripts/test_insert_2.`json`\", response=\"f5d58bcbccc9119fbf71f851ac4e90f0\", opaque=\"\"",
'cache-control': "no-cache",
'postman-token': "52c1f629-5bb9-e16c-5693-16d8d6001e2d"
}
`conn`.`request`("GET", "/v1/documents?`uri`=%2Fscripts%2Ftest_insert_2.`json`", headers=headers)
res = `conn`.`getresponse`()
data = res.read()
print(data.decode("utf-8"))
此功能可以幫助我在MarkLogic DB尋找特定關鍵字Reading and Writing Multiple Documents section。 –
這將幫助您從特定集合中獲取文檔。 –