codeigniter
Codeigniter LIKE with wildcard(%)
$this->db->like() automatically adds the %s and escapes the string. So all you need is $this->db->like(‘title’, $query); $res = $this->db->get(‘film’); See the CI documentation for reference: CI 2, CI 3, CI 4
Removing specific items from array with MongoDB
If you can identify the comment item by matching userid, name or comment — then you can remove that comment using update() command with $pull modifier along with the appropriate condition. If you cannot do as above, include an unique id in the comments (like UUID). To delete the comment, do the following: db.coll.update({<cond to … Read more