We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
try { $this->odb = new OrientDB('localhost',2424); $connect = $this->odb->connect('gms', 'gms123'); $clusters = $this->odb->DBOpen('gms', 'gms', 'gms123'); $records = $this->odb->query("select * from coupon_package where is_deleted = 0"); print_r( $records); }catch (OrientDBException $e) { die("internal"); }
response ouput:
Array ( [0] => OrientDBRecord Object ( [isParsed:OrientDBRecord:private] => [className:OrientDBRecord:private] => [type] => d [clusterID:OrientDBRecord:private] => 12 [recordPos:OrientDBRecord:private] => 10 [recordID:OrientDBRecord:private] => 12:10 [version] => 6 [content:OrientDBRecord:private] => coupon_package@is_deleted:false,package_name:"sdfsdere",no_of_coupons:123123,amount:1231232.0d,description:"gdvdsdfs",type:"Agency",created_date:1398191400000t [data] => OrientDBData Object ( [data:OrientDBData:private] => Array ( ) [record:OrientDBData:private] => OrientDBRecord Object RECURSION ) ) [1] => OrientDBRecord Object ( [isParsed:OrientDBRecord:private] => [className:OrientDBRecord:private] => [type] => d [clusterID:OrientDBRecord:private] => 12 [recordPos:OrientDBRecord:private] => 11 [recordID:OrientDBRecord:private] => 12:11 [version] => 3 [content:OrientDBRecord:private] => coupon_package@is_deleted:false,package_name:"rdgervfdvsdf",no_of_coupons:23423423,amount:2.3131232E7d,description:"xcgdgdfddfvdf",type:"Agency",created_date:1398191400000t [data] => OrientDBData Object ( [data:OrientDBData:private] => Array ( ) [record:OrientDBData:private] => OrientDBRecord Object RECURSION ) ) [2] => OrientDBRecord Object ( [isParsed:OrientDBRecord:private] => [className:OrientDBRecord:private] => [type] => d [clusterID:OrientDBRecord:private] => 12 [recordPos:OrientDBRecord:private] => 12 [recordID:OrientDBRecord:private] => 12:12 [version] => 3 [content:OrientDBRecord:private] => coupon_package@is_deleted:false,package_name:"sdfsfed",no_of_coupons:12312321,amount:221312.0d,description:"zxfasdfsdaf",type:"Agency",created_date:1398191400000t [data] => OrientDBData Object ( [data:OrientDBData:private] => Array ( ) [record:OrientDBData:private] => OrientDBRecord Object RECURSION ) ) [3] => OrientDBRecord Object ( [isParsed:OrientDBRecord:private] => [className:OrientDBRecord:private] => [type] => d [clusterID:OrientDBRecord:private] => 12 [recordPos:OrientDBRecord:private] => 13 [recordID:OrientDBRecord:private] => 12:13 [version] => 3 [content:OrientDBRecord:private] => coupon_package@is_deleted:false,package_name:"sdfsdsdcasd",no_of_coupons:23423423,amount:2342423.0d,description:"xzfaxcasdcsd",type:"Agency",created_date:1398191400000t [data] => OrientDBData Object ( [data:OrientDBData:private] => Array ( ) [record:OrientDBData:private] => OrientDBRecord Object RECURSION ) ) [4] => OrientDBRecord Object ( [isParsed:OrientDBRecord:private] => [className:OrientDBRecord:private] => [type] => d [clusterID:OrientDBRecord:private] => 12 [recordPos:OrientDBRecord:private] => 14 [recordID:OrientDBRecord:private] => 12:14 [version] => 1 [content:OrientDBRecord:private] => coupon_package@is_deleted:false,package_name:"sdfsdf",no_of_coupons:42342343,amount:2342343.0d,description:"sdfsdfsdcsdc",type:"Agency",created_date:1398191400000t [data] => OrientDBData Object ( [data:OrientDBData:private] => Array ( ) [record:OrientDBData:private] => OrientDBRecord Object RECURSION ) ) [5] => OrientDBRecord Object ( [isParsed:OrientDBRecord:private] => [className:OrientDBRecord:private] => [type] => d [clusterID:OrientDBRecord:private] => 12 [recordPos:OrientDBRecord:private] => 15 [recordID:OrientDBRecord:private] => 12:15 [version] => 1 [content:OrientDBRecord:private] => coupon_package@is_deleted:false,package_name:"asdasds",no_of_coupons:123123,amount:312312.0d,description:"asddasd",type:"Agency",created_date:1398191400000t [data] => OrientDBData Object ( [data:OrientDBData:private] => Array ( ) [record:OrientDBData:private] => OrientDBRecord Object RECURSION ) ) )
After convert json format the output:
[{"type":"d","version":6,"data":{}},{"type":"d","version":3,"data":{}},{"type":"d","version":3,"data":{}},{"type":"d","version":3,"data":{}},{"type":"d","version":1,"data":{}},{"type":"d","version":1,"data":{}}]
please suggest me how to get properties value in data nodes
The text was updated successfully, but these errors were encountered:
Well, seems that json_encode() does not call $record-parse(), so you'd have to manually parse each record in array like
json_encode()
$record-parse()
foreach($records as $record) { $record->parse(); } echo json_encode($records);
or create new array from each record's data attribute and encode this new array. Hope this will help.
data
Sorry, something went wrong.
After doing this there is a message of Maximum execution time of 30 seconds exceeded. and didn't work.
No branches or pull requests
try {
$this->odb = new OrientDB('localhost',2424);
$connect = $this->odb->connect('gms', 'gms123');
$clusters = $this->odb->DBOpen('gms', 'gms', 'gms123');
$records = $this->odb->query("select * from coupon_package where is_deleted = 0");
print_r( $records);
}catch (OrientDBException $e) {
die("internal");
}
response ouput:
Array ( [0] => OrientDBRecord Object ( [isParsed:OrientDBRecord:private] => [className:OrientDBRecord:private] => [type] => d [clusterID:OrientDBRecord:private] => 12 [recordPos:OrientDBRecord:private] => 10 [recordID:OrientDBRecord:private] => 12:10 [version] => 6 [content:OrientDBRecord:private] => coupon_package@is_deleted:false,package_name:"sdfsdere",no_of_coupons:123123,amount:1231232.0d,description:"gdvdsdfs",type:"Agency",created_date:1398191400000t [data] => OrientDBData Object ( [data:OrientDBData:private] => Array ( ) [record:OrientDBData:private] => OrientDBRecord Object RECURSION ) ) [1] => OrientDBRecord Object ( [isParsed:OrientDBRecord:private] => [className:OrientDBRecord:private] => [type] => d [clusterID:OrientDBRecord:private] => 12 [recordPos:OrientDBRecord:private] => 11 [recordID:OrientDBRecord:private] => 12:11 [version] => 3 [content:OrientDBRecord:private] => coupon_package@is_deleted:false,package_name:"rdgervfdvsdf",no_of_coupons:23423423,amount:2.3131232E7d,description:"xcgdgdfddfvdf",type:"Agency",created_date:1398191400000t [data] => OrientDBData Object ( [data:OrientDBData:private] => Array ( ) [record:OrientDBData:private] => OrientDBRecord Object RECURSION ) ) [2] => OrientDBRecord Object ( [isParsed:OrientDBRecord:private] => [className:OrientDBRecord:private] => [type] => d [clusterID:OrientDBRecord:private] => 12 [recordPos:OrientDBRecord:private] => 12 [recordID:OrientDBRecord:private] => 12:12 [version] => 3 [content:OrientDBRecord:private] => coupon_package@is_deleted:false,package_name:"sdfsfed",no_of_coupons:12312321,amount:221312.0d,description:"zxfasdfsdaf",type:"Agency",created_date:1398191400000t [data] => OrientDBData Object ( [data:OrientDBData:private] => Array ( ) [record:OrientDBData:private] => OrientDBRecord Object RECURSION ) ) [3] => OrientDBRecord Object ( [isParsed:OrientDBRecord:private] => [className:OrientDBRecord:private] => [type] => d [clusterID:OrientDBRecord:private] => 12 [recordPos:OrientDBRecord:private] => 13 [recordID:OrientDBRecord:private] => 12:13 [version] => 3 [content:OrientDBRecord:private] => coupon_package@is_deleted:false,package_name:"sdfsdsdcasd",no_of_coupons:23423423,amount:2342423.0d,description:"xzfaxcasdcsd",type:"Agency",created_date:1398191400000t [data] => OrientDBData Object ( [data:OrientDBData:private] => Array ( ) [record:OrientDBData:private] => OrientDBRecord Object RECURSION ) ) [4] => OrientDBRecord Object ( [isParsed:OrientDBRecord:private] => [className:OrientDBRecord:private] => [type] => d [clusterID:OrientDBRecord:private] => 12 [recordPos:OrientDBRecord:private] => 14 [recordID:OrientDBRecord:private] => 12:14 [version] => 1 [content:OrientDBRecord:private] => coupon_package@is_deleted:false,package_name:"sdfsdf",no_of_coupons:42342343,amount:2342343.0d,description:"sdfsdfsdcsdc",type:"Agency",created_date:1398191400000t [data] => OrientDBData Object ( [data:OrientDBData:private] => Array ( ) [record:OrientDBData:private] => OrientDBRecord Object RECURSION ) ) [5] => OrientDBRecord Object ( [isParsed:OrientDBRecord:private] => [className:OrientDBRecord:private] => [type] => d [clusterID:OrientDBRecord:private] => 12 [recordPos:OrientDBRecord:private] => 15 [recordID:OrientDBRecord:private] => 12:15 [version] => 1 [content:OrientDBRecord:private] => coupon_package@is_deleted:false,package_name:"asdasds",no_of_coupons:123123,amount:312312.0d,description:"asddasd",type:"Agency",created_date:1398191400000t [data] => OrientDBData Object ( [data:OrientDBData:private] => Array ( ) [record:OrientDBData:private] => OrientDBRecord Object RECURSION ) ) )
After convert json format the output:
[{"type":"d","version":6,"data":{}},{"type":"d","version":3,"data":{}},{"type":"d","version":3,"data":{}},{"type":"d","version":3,"data":{}},{"type":"d","version":1,"data":{}},{"type":"d","version":1,"data":{}}]
please suggest me how to get properties value in data nodes
The text was updated successfully, but these errors were encountered: