Permalink
Browse files

Fixes #907

  • Loading branch information...
aheinze committed Nov 24, 2018
1 parent e0d096c commit 4a9057541de1b557bdc92e9ea1497a3609732d16
Showing with 0 additions and 15 deletions.
  1. +0 −15 lib/MongoLite/Collection.php
@@ -73,14 +73,6 @@ public function insert(&$document) {
*/
protected function _insert(&$document) {
//JSON_NUMERIC_CHECK - without destroying values with leading zeros
array_walk_recursive($document, function (&$val, $key) {
if (is_string($val) && is_numeric($val) && $val[0] !== '0') {
$val += 0;
}
});
$table = $this->name;
$document['_id'] = isset($document['_id']) ? $document['_id'] : createMongoDbLikeId();
$data = ['document' => json_encode($document, JSON_UNESCAPED_UNICODE)];
@@ -131,13 +123,6 @@ public function update($criteria, $data) {
$stmt = $this->database->connection->query($sql);
$result = $stmt->fetchAll(\PDO::FETCH_ASSOC);
array_walk_recursive($data, function (&$val, $key) {
if (is_string($val) && is_numeric($val) && $val[0] !== '0') {
$val += 0;
}
});
foreach ($result as &$doc) {
$document = array_merge(json_decode($doc['document'], true), $data);

0 comments on commit 4a90575

Please sign in to comment.