def meta_fact_update(method, ts_begin, ts_end)
      connection[meta_collection].find_one_and_update(
        {},
        {
          '$set' => {
            last_fact_update: {
              ts_begin: ts_begin.iso8601,
              ts_end:   ts_end.iso8601,
              method:   method
            },
            method => {
              ts_begin: ts_begin.iso8601,
              ts_end:   ts_end.iso8601
            }
          }
        },
        { upsert: true }
      )
    end
def meta_fact_update(method, ts_begin, ts_end)
      connection[meta_collection].find_one_and_update(
        {},
        {
          '$set' => {
            last_fact_update: {
              ts_begin: ts_begin.iso8601,
              ts_end:   ts_end.iso8601,
              method:   method
            },
            method => {
              ts_begin: ts_begin.iso8601,
              ts_end:   ts_end.iso8601
            }
          }
        },
        { upsert: true }
      )
    end
update or insert timestamps for given fact update method