Converting a mySQL table with id's to a MongoDB table with _id's -
i'm transferring mysql table mongodb. there primary key id in mysql table , want id converted _id in mongodb.
i use php's mongocollection::insert( $mysql_array );
however doesn't work because if set $mysql_array['_id'] seen mongo string instead of mongoid. tried $mysql_array['_id'] = new mongoid( $id ) doesn't allow me override default _id value. saw mysql's integer columns converted string mongocollection::insert(). if set mongocollection::insert() correctly transfer integer maybe work.
typecast _id integer value this...
(int) $mysql_array['_id']
you'll find doing lot in mongodb
Comments
Post a Comment