Skip to content

Instantly share code, notes, and snippets.

@alphaville
Last active August 29, 2015 14:13
Show Gist options
  • Select an option

  • Save alphaville/a4c18c905916551407a9 to your computer and use it in GitHub Desktop.

Select an option

Save alphaville/a4c18c905916551407a9 to your computer and use it in GitHub Desktop.
{
"id": 100,
"status":"COMPLETED",
"http_status":200,
"result": "http://opentox.ntua.gr:8080/model/234",
"duration":452,
"progress":[
"data loaded",
"new resources have been created",
"now training the model",
"model training completed",
"result: OK"
],
"creator":"[email protected]",
"time_created":"2015-12-01 14:04:45 CET"
}
{
"id": 100,
"status":"ERROR",
"http_status":400,
"duration":200,
"progress":[
"data loaded",
"new resources have been created",
"now training the model",
"failed!"
],
"creator":"[email protected]",
"time_created":"2015-12-01 14:04:45 CET",
"error_report":{
"error_code":"XR243",
"actor":"client with ip 10.8.0.4",
"message":"Malformed input data",
"details":"Provide some details here to assist debugging",
"trace": {
"comment":"some other error report goes here if necessary"
}
}
}
{
"id": 100,
"status":"RUNNING",
"percentage":57,
"http_status":202,
"progress":[
"data loaded",
"new resources have been created",
"now training the model"
],
"creator":"[email protected]",
"time_created":"2015-12-01 14:04:45 CET"
}
// Compound index for `creator` and `status`
// See http://docs.mongodb.org/manual/core/index-compound/
db.tasks.ensureIndex({"creator":1, "status":1});
db.tasks.ensureIndex({"creator":1});
db.tasks.ensureIndex({"status":1});
// Update a task
db.tasks.update(
{ "id":102 },
{ $addToSet:
{ "progress": "moved to step 4" }
}
);
// Return the document of a task without including
// the field `progress`
db.tasks.find({id:102}, {progress:0}).pretty();
// Get just the status:
db.tasks.find({id:102}, {status:1}).pretty();
{
"id":"[email protected]",
"name":"Guest Guestopoulos",
"timestamp":"2015-01-01 15:08:01 CET",
"password":"SDF#YHFDJSNF5443#*@RY",
"email":"[email protected]",
"max_models":10000,
"max_bibtex":-1,
"max_compounds":50000,
"max_parallel_tasks":5
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment