From 47d9b018d30223078ea44dee5305dfa2225ce95b Mon Sep 17 00:00:00 2001 From: Florian Forster Date: Mon, 5 Mar 2012 10:35:58 +0100 Subject: [PATCH] write_mongodb plugin: Actually store time as "date" type. --- src/write_mongodb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/write_mongodb.c b/src/write_mongodb.c index f61d6224..4f866bc8 100644 --- a/src/write_mongodb.c +++ b/src/write_mongodb.c @@ -87,7 +87,7 @@ static int wm_write (const data_set_t *ds, /* {{{ */ ssnprintf(collection_name, sizeof (collection_name), "collectd.%s", vl->plugin); bson_init(&record); - bson_append_double (&record, "time", CDTIME_T_TO_DOUBLE (vl->time)); + bson_append_date (&record, "time", (bson_date_t) CDTIME_T_TO_MS (vl->time)); bson_append_string (&record, "host", vl->host); bson_append_string (&record, "plugin_instance", vl->plugin_instance); bson_append_string (&record, "type", vl->type); -- 2.30.2