javascript - RethinkDB, add elements to an array that's nested -


using example here, i've added 1 more level notes, it's mapped object elements hold arrays

{     id: 10001,     name: "bob smith",     notes: {         alpha:['note1','note2','note3'],         beta:['note1','note2','note3']     } } 

cannot life of me figure out how append elements alpha , beta however. i've tried variations of this:

update({      notes:{           alpha: r.row("alpha").append('note4')       }  }) 

but not getting anywhere.
appreciated~

oh , error message no attribute 'alpha' in object:

you following:

r.db('test')  .table('user')  .get('10001')  .update({    notes: {      alpha: r.row('notes')('alpha').append('note4'),      beta: r.row('notes')('beta').append('note4')    }  }).run(); 

Comments

Popular posts from this blog

mongodb - Struggling to get ordered results from the last retrieved article, given array of elements to search in -

c# - Pausing a storyboard on TabItem mouse over -

c# - Attribute value in root node of xml Linq to XML -