0
我有以下結構:rethinkdb更新嵌套陣列
{ "id": "3065e957-56e9-4084-8e32-bb4de8d9265a", "id_service": "570b4abe-70fe-44e0-845e-74eb60081fc4", "tweets": [ { "created_at": "2013-10-13 00:58:11", "id_tweet": "389193311908413440", "id_user": 12375562, "name": "elgabo1", "photo": "https://pbs.twimg.com/profile_images/1827710728/45d1be6d2e0f1c710814e098d6f56c12_normal.png", "screen_name": "elgabo1", "status_tweet": 0, "text": "@profeco Deurope Gran Sur tapa los sellos de suspensión con propaganda" }, { "created_at": "2013-10-02 06:50:01", "id_tweet": "385295588377387008", "id_user": 12375562, "name": "elgabo1", "photo": "https://pbs.twimg.com/profile_images/1827710728/45d1be6d2e0f1c710814e098d6f56c12_normal.png", "screen_name": "elgabo1", "status_tweet": 1, "text": "@caspoliciadf Delegacion coyoacan" } ] }
我想設置status_tweet:1從id_tweet:「389193311908413440」
我可以得到與id_tweet數組的元素: 「389193311908413440」
r.db('twitter_settings').table('tweets_service').filter({id:'3065e957-56e9-4084-8e32-bb4de8d9265a'}) .map(function(d){ return { "tweets": d("tweets").filter({'id_tweet':'665305939294056448'}) } } )
但是,當我嘗試更新的字段我得到一個錯誤:
r.db('twitter_settings').table('tweets_service').filter({id:'3065e957-56e9-4084-8e32-bb4de8d9265a'}) .map(function(d){ return { "tweets": d("tweets").filter({'id_tweet':'665305939294056448'}) } } ) .update({"status_tweet": 1}) e: Expected type SELECTION but found SEQUENCE: VALUE SEQUENCE in: r.db("twitter_settings").table("tweets_service").filter({id: "3065e957-56e9-4084-8e32-bb4de8d9265a"}).map(function(var_341) { return {tweets: var_341("tweets").filter({id_tweet: "665305939294056448"})}; }).update({status_tweet: 1}) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
在此先感謝