php - Is this possible to do in RethinkDB -
i've used mongodb in past , want use similar schema. i've tried create using php driver doesn't work expected. guesses either rethinkdb not support or php driver not capable this.
r\table('user')->insert([ 'username' => 'something', 'skills' => [ 'php' => 10, 'html' => 15 ] ])->run($conn)
result in rethinkdb administrator js client:
{ "username": "something" , "id": "899a2693-dd94-4670-a496-05626a88d190" , "skills": { } }
what suggest , how should this?
it seems work php 5.4.13, rethinkdb 1.5.1 , lastest version of php-rql.
r\table('user')->insert([ 'username' => 'something', 'skills' => [ 'php' => 10, 'html' => 15 ] ])->run($conn);
it gives following results:
$result = r\db("test")->table("user")->run($conn); print_r($result->tonative()); array ( [0] => array ( [username] => [skills] => array ( [php] => 10 [html] => 15 ) [id] => 2c66490f-72da-49ad-9692-a85366ce94ab ) )
and in data explorer:
[ { "username": "something" , "skills": { "php": 10 , "html": 15 } , "id": "2c66490f-72da-49ad-9692-a85366ce94ab" } ]
Comments
Post a Comment