Hey guys I have got a problem with updating value of key in the collection using Meteor / Mongo
data: {
'id': id,
'fb_id': fbId,
'name': fbName,
'access_token': fbAccessToken,
'symbol': fbSymbol,
'config': {
'get_started': {
'payload': getStarted
},
'persistent_menu': [
{
'locale': 'default',
'call_to_actions': [
{
'type': 'postback',
'title': persistentMenu1,
'payload': 'menu'
},
{
'type': 'postback',
'title': persistentMenu2,
'payload': 'knowledge_base'
},
{
'type': 'nested',
'title': persistentMenu3,
'call_to_actions': [
{
'type': 'postback',
'title': nestedPersistentMenu1,
'payload': 'subscription'
},
{
'type': 'postback',
'title': nestedPersistentMenu2,
'payload': 'tth'
}
]
}
],
'composer_input_disabled': false
},
{
'locale': 'pl_PL',
'call_to_actions': [
{
'type': 'postback',
'title': persistentMenu1,
'payload': 'menu'
},
{
'type': 'postback',
'title': persistentMenu2,
'payload': 'knowledge_base'
},
{
'type': 'nested',
'title': persistentMenu3,
'call_to_actions': [
{
'type': 'postback',
'title': 'Subskrypcja',
'payload': 'subscription'
},
{
'type': 'postback',
'title': 'Konsultant',
'payload': 'tth'
}
]
}
],
'composer_input_disabled': false
}
],
'greeting': [
{
'locale': 'default',
'text': somethingNew
},
{
'locale': 'pl_PL',
'text': greetingsText
}
]
},
'created_at': '2017-06-05T06:00:37.759455Z',
'updated_at': updatedAt
}
})
I need to get to second element in "greeting" array and change value of 'text' which is "greetingsText" at the moment
I tried to do so using console in the browser by typing this code
Collection.update({_id: "some_id"}, {$set: {fanpageInfo: {config: {"greeting.2": {text: "tata"}}}}}) but it doesnt work unfortunately
there is error saying "update failed:
MongoError: The dotted field 'greeting.2' in 'fanpageInfo.config.greeting.2' is not valid for storage."
And to be honest I am not sure if I am targeting it properly - I checked docs and asked google but there are just simple tutorials.
Thanks in advance for any help