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

c# - How Configure Devart dotConnect for SQLite Code First? -

java - Copying object fields -

c++ - Clear the memory after returning a vector in a function -