Skip to content

Instantly share code, notes, and snippets.

@dmregister
Created May 7, 2015 16:14
Show Gist options
  • Save dmregister/7975b6f9f0267d0bc4a3 to your computer and use it in GitHub Desktop.
Save dmregister/7975b6f9f0267d0bc4a3 to your computer and use it in GitHub Desktop.
php insert task
$db = $mongoClient->test;
$taskcollection = $db->task_;
$taskDetailscollection = $db->task;
$taskDetailsdocument = array(
"creator" => "testing",
"callable" => "mailer:sendEmail",
"args" => array(),
"kwargs" => new \stdClass()),
"created" => new \MongoDate(),
"state" => "new",
"owner" => null,
"result" => null
);
$taskDetailscollection->insert($taskDetailsdocument);
$taskdocument = array(
"creator" => "testing",
"job_id" => $taskDetailsdocument['_id']
);
$taskcollection->insert($taskdocument);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment