![]() |
CI Library for MySQL to act as MongoDB - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: CI Library for MySQL to act as MongoDB (/showthread.php?tid=48368) |
CI Library for MySQL to act as MongoDB - El Forum - 01-13-2012 [eluser]Mareshal[/eluser] I know MySQL can't and will never be like MongoDB, but following MongoDB's concept of being schema-less, I am building a library that should do the following: Let's say you have no table create. Executing the following code: Code: Dbm::insert('t3', array('fieldA' => rand())); 1. create the table 't3' if not exists. If 't3' is created, the library also adds a 'id' field with autoincrement. 2. create fieldA if it doesn't exist in the table. If value from fieldA is numeric, fieldA will be INT(11), or if is string fieldA will be VARCHAR(255) 3. insert the data and return the insert_id Same thing applies to update. Please tell me what do you think. |