Skip to content

Commit b63d131

Browse files
committed
Makes the 'created' and 'modified' keys optional: if $mongoSchema is defined without these keys
Thanks @YOMorales #31
1 parent 6ee3069 commit b63d131

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

models/datasources/mongodb_source.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -395,7 +395,7 @@ public function describe(&$Model, $field = null) {
395395
$schema = array();
396396
if (!empty($Model->mongoSchema) && is_array($Model->mongoSchema)) {
397397
$schema = $Model->mongoSchema;
398-
return $schema + $this->_defaultSchema;
398+
return $schema + array('_id' => $this->_defaultSchema['_id']);
399399
} elseif ($this->isConnected() && is_a($Model, 'Model') && !empty($Model->Behaviors)) {
400400
$Model->Behaviors->attach('Mongodb.Schemaless');
401401
if (!$Model->data) {

0 commit comments

Comments
 (0)