我可能已经弄乱了JSON查询的语法,但是我一生都看不到哪里。尝试创建data.frame概述按四个值分组的数据,具有额外的COUNT功能。
overviewData <- M_CONNECTION$aggregate('[
{
"$group" : {
"_id" : {
"Hotel_Name" : "$Hotel_Name",
"lat" : "$lat",
"lng" : "$lng",
"Average_Score" : "$Average_Score"
},
"COUNT(Hotel_Name)" : {
"$sum" : NumberInt(1)
}
}
},
{
"$project" : {
"Hotel_Name" : "$_id.Hotel_Name",
"lat" : "$_id.lat",
"lng" : "$_id.lng",
"Average_Score" : "$_id.Average_Score",
"COUNT(Hotel_Name)" : "$COUNT(Hotel_Name)",
"_id" : NumberInt(0)
}
}
]',
options = '{"allowDiskUse" : true}'
)
所有查询以及选项周围都有引号。仍然收到“无效的JSON对象”错误消息。
答案 0 :(得分:0)
尽管我不确定,但我猜这行给您带来麻烦->
UPDATE [Roles]
SET
WHERE ([Id] = @p0) AND ([Name] = @p1)
-- @p0: Input String (Size = 4000; Prec = 0; Scale = 0) [ea34d99e-8ad5-4fa7-83f3-5cf3ac282da6]
-- @p1: Input String (Size = 4000; Prec = 0; Scale = 0) [Role 1]
-- Context: SqlProvider(Sql2008) Model: AttributedMetaModel Build: 4.7.3056.0
而不是这个,请尝试这个->
"$sum" : NumberInt(1)
请尝试一下,让我知道是否有帮助。