1
查詢迴應是不是從ActiveRecord我怎樣才能得到與外部查詢(不與ActiveRecord)的API緩存
和響應是JSON格式。
我怎麼會緩存返回結果
def get_drug_usage_history_by_symptoms
pipeline_work = [
{"$unwind" => "$records"},
{'$match' => {'records.items' => {'$in' => items} }},
{'$limit' => 8 } # FOR DEVELOPMENT USE
]
cur = db[collection].find.aggregate(pipeline_work).allow_disk_use(true)
respond_to do |format|
format.json { render json: cur.to_a }
end
end