【发布时间】:2021-02-25 15:10:34
【问题描述】:
是否可以在我的目标键上使用 substr 来区分 runCommand?
我不断收到missing : after property id :
db.runCommand(
{
distinct: "mycollection",
key: {"myfield" : { $substr: { "$myfield", 0, 10 } }},
}
)
【问题讨论】:
-
清晰性:您想获得
myfield的不同值,然后 然后 执行子字符串或先执行子字符串,然后从中获取不同的值? -
@BuzzMoschetti 我想要区分子字符串
标签: mongodb substring distinct substr runcommand