Efficient is something strange, without the real data it is hard to challenge… You could use XSLT to transform the document and remove the element. For larger replies that is what I would go for.
Otherwise:
for $i in collection(“yourcollection”)
where $i/Customer/Name=“Joe A”
return {$i/Customer/Name/text()}…
Just return everything this way but the Secret.
Depends on the size of your application and the number of documents, I would expect this to be fast. But efficient?? Depends on what variables and benchmarks you are using. Transforming in a query is no fun, but XSLT isn’t either. Processing time I don’t know, you’d need to test it.
#Tamino#webMethods#API-Management