我正在使用mongodb,我的查询只返回一个键值
以下是var_dump
<pre>array (size=471)
0 =>
array (size=1)
'sno' => string '162230' (length=6)
1 =>
array (size=1)
'sno' => string '165333' (length=6)
2 =>
array (size=1)
'sno' => string '181312' (length=6)
3 =>
array (size=1)
'sno' => string '181313' (length=6)
4 =>
array (size=1)
'sno' => string '181314' (length=6)
5 =>
array (size=1)
'sno' => string '181315' (length=6)
6 =>
array (size=1)
'sno' => string '181316' (length=6)
7 =>
array (size=1)
'sno' => string '181317' (length=6)
8 =>
array (size=1)
'sno' => string '181318' (length=6)
9 =>
array (size=1)
'sno' => string '181319' (length=6)
10 =>
array (size=1)
'sno' => string '181320' (length=6)</pre>
我不想要钥匙。我想要的是一个没有循环的值数组。
答案 0 :(得分:1)
解决了它。
<xp:this.converter>
<xp:customConverter>
<xp:this.getAsString><![CDATA[#{javascript:
value.toFixed(0).replace(/(\d)(?=(\d{3})+(?!\d))/g, "$1 ") + " kr"
}]]></xp:this.getAsString>
<xp:this.getAsObject><![CDATA[#{javascript:
parseFloat(value.replace(" ", ""))
}]]></xp:this.getAsObject>
</xp:customConverter>
</xp:this.converter>