Skip to content

MongoCollection::insert() must be of the type array #10

@fredrikpaulin

Description

@fredrikpaulin

Warning (4096): Argument 2 passed to MongoCollection::insert() must be of the type array, boolean given, called in /var/www/lib/Cake/Model/Model.php on line 1734 and defined [APP/Plugin/Mongodb/Model/Datasource/MongodbSource.php, line 465]
Notice (8): Undefined index: _id [APP/Plugin/Mongodb/Model/Datasource/MongodbSource.php, line 476]
Notice (8): Undefined index: _id [APP/Plugin/Mongodb/Model/Datasource/MongodbSource.php, line 477]

And the code:
$note = array(
'type' => 'connection',
'message' => 'connected to',
'user' => $us,
'subject' => $id
);

    if($this->Notification->save($note)){
        $this->log('added note', 'debug');
    }
    else{
        $this->log('failed to add note', 'debug');
    }

Any ideas?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions