How to select from array in Rethinkdb? -


i have field bidder arrays , objects this(it can empty):

[    [       {          "date":"08/17/1999"       },       {          "time":"07:15:23"       },       {          "increase":31.5       }    ],    [       {          "date":"04/01/1998"       },       {          "time":"01:06:18"       },       {          "increase":10.5       }    ] ] 

how can select first-array's increase value means output should 31.5.

in javascript

r.table('test')('bidder').nth(0)('increase').run(conn, callback) 

in python , ruby

r.table('test')['bidder'][0]['increase'].run(conn) 

edit: queries documents if need more complex things returning value, can use general "form" map

r.table('test').map(function(doc) {    return doc('bidder').nth(0)('increase') }).run(conn, callback) 

Comments

Popular posts from this blog

apache - Remove .php and add trailing slash in url using htaccess not loading css -

javascript - jQuery show full size image on click -