You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何在queryDef中查询收件人全部字段而非逐个选择

How to Retrieve All Fields for nms:recipient Without Manual Selection

Hey there! To grab all fields from the nms:recipient schema instead of listing each one manually, you can use the wildcard * in your <select> node. This tells the query definition to fetch every available field for the matching recipients.

Here's your updated code:

var query = xtk.queryDef.create( 
<queryDef schema="nms:recipient" operation="getIfExists">
 <select>
  <!-- Use wildcard to fetch all fields -->
  <node expr="*"/>
 </select>
 <where>
  <condition expr={"@Id='93975738'"}/>
  <condition expr={"@company='xxxx'"}/>
 </where>
</queryDef>)
var result = query.ExecuteQuery();
logInfo(result.toXMLString());

A Quick Note:

  • The expr="*" acts as a wildcard that includes all top-level fields of the nms:recipient schema. This saves you from manually enumerating every field like @firstName, @lastName, etc.
  • If you ever need to exclude specific fields while keeping the rest, you can add an exclude attribute to a node. For example:
    <select>
      <node expr="*"/>
      <!-- Exclude a specific sensitive/unneeded field -->
      <node expr="[@password]" exclude="true"/>
    </select>
    
  • Keep in mind that fetching all fields might include some system-generated or unused fields, but it's perfect when you need the full recipient record without missing anything.

内容的提问来源于stack exchange,提问作者AZahlan

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.27 07:12:01