如何连接两个字段中的值并将其放入第三个字段中,值为字符串.我试过这个:
db.collection.update({"_id" : { $exists : true }},
{$set: {column_2:{$add:['$column_4',
'$column_3']}}},
false, true)
Run Code Online (Sandbox Code Playgroud)
虽然似乎不起作用,但是抛出not ok for storage.我也试过这个:
db.collection.update({"_id" : { $exists : true }},
{$set: {column_2:{$add:['a',
'b']}}},
false, true)
Run Code Online (Sandbox Code Playgroud)
但即使这显示同样的错误not ok for storage.
我想只在mongo服务器上连接而不是在我的应用程序中连接.
string-concatenation mongodb mongodb-query mongodb-update aggregation-framework
mongodb ×1