Ini adalah file properti dokumen di Marklogic
<?xml version="1.0" encoding="UTF-8"?>
<prop:properties xmlns:prop="http://marklogic.com/xdmp/property">
<type type="string" xmlns="http://marklogic.com/xdmp/json/basic">document</type>
<project type="string" xmlns="http://marklogic.com/xdmp/json/basic">Eagle</project>
<fileroom type="string" xmlns="http://marklogic.com/xdmp/json/basic">Fileroom3</fileroom>
<documentTitle type="string" xmlns="http://marklogic.com/xdmp/json/basic">HadoopOperations</documentTitle>
<uploadDate type="string" xmlns="http://marklogic.com/xdmp/json/basic">2015-08-21T12:45:19.138Z</uploadDate>
<lastModified type="string" xmlns="http://marklogic.com/xdmp/json/basic">2015-08-21T12:45:19.138Z</lastModified>
<numPages type="number" xmlns="http://marklogic.com/xdmp/json/basic">11</numPages>
<users type="array" xmlns="http://marklogic.com/xdmp/json/basic">
<item type="string">[email protected]</item>
<item type="string">[email protected]</item>
</users>
<cpf:processing-status xmlns:cpf="http://marklogic.com/cpf">done</cpf:processing-status>
<cpf:property-hash xmlns:cpf="http://marklogic.com/cpf">77ecfa8e87a5097e29b4d9846e131a67</cpf:property-hash>
<cpf:last-updated xmlns:cpf="http://marklogic.com/cpf">2015-08-21T18:15:19.333+05:30</cpf:last-updated>
<cpf:state xmlns:cpf="http://marklogic.com/cpf">http://marklogic.com/states/converted</cpf:state>
<lnk:link from="/Eagle/Fileroom3/HadoopOperations_pdf_parts/" to="/Eagle/Fileroom3/HadoopOperations.pdf" rel="source" rev="conversion" strength="strong" xmlns:lnk="http://marklogic.com/cpf/links"/>
<lnk:link from="/Eagle/Fileroom3/HadoopOperations_pdf.xhtml" to="/Eagle/Fileroom3/HadoopOperations.pdf" rel="source" rev="conversion" strength="strong" xmlns:lnk="http://marklogic.com/cpf/links"/>
<cpf:self xmlns:cpf="http://marklogic.com/cpf">/Eagle/Fileroom3/HadoopOperations.pdf</cpf:self>
<prop:last-modified>2015-08-21T18:15:23+05:30</prop:last-modified>
</prop:properties>
Saya ingin menulis pertanyaan, di mana saya perlu menemukan dokumen di mana properti users
memiliki "[email protected]".
db.documents.query(
qb.where(
qb.directory(directories),
qb.propertiesFragment(
qb.value(
qb.element(
qb.qname("http://marklogic.com/xdmp/json/basic", "users")
),
qb.term("admin.merrill.com")
)
)
).withOptions({
queryPlan: true,
metrics:true,
debug:true})
).result(function(response){
console.log(response);
});
Keluaran:
[ { 'snippet-format': 'snippet',
total: 0,
start: 1,
'page-length': 10,
results: [],
plan: { 'query-plan': [Object] },
report: '(cts:search(fn:collection(), cts:and-query((cts:directory-query("/Eagle/Fileroom1/", "1"), cts:properties-fragment-query(cts:element-value-query(fn:QName("http://marklogic.com/xdmp/json/basic","users"), "admin.merrill.com", ("lang=en"), 1))), ()), ("unfiltered",cts:score-order("descending")), 1))[1 to 10]',
metrics:
{ 'query-resolution-time': 'PT0.015S',
'snippet-resolution-time': 'PT0S',
'total-time': 'PT0.172S' } } ]
Tapi mendapatkan array kosong. Tolong bantu untuk memperbaiki pertanyaan ini.