class MongoHTTPSync::MongoImporter
Protected Instance Methods
find_last_updated_doc()
click to toggle source
# File lib/mongo_http_sync/mongo_importer.rb, line 10 def find_last_updated_doc @output.find({}, sort: { updated_at: -1 }, limit: 1).first end
upsert(json)
click to toggle source
# File lib/mongo_http_sync/mongo_importer.rb, line 14 def upsert(json) @output.find(_id: json[:_id]).update_one(json, upsert: true) end