public function keywords() { $limit = 25; $projections = array('id', 'value'); $keywords = DB::collection('map_reduce_twitter_words')->orderBy('value', 'desc')->paginate($limit, $projections); return view('keywords')->with(['keywords' => $keywords]); }
public function getByValue($field, $value) { // Returns the original Mongo Result // ->where('store.name', 'like', '%' . $field . '%') $result = DB::collection('food_cards_collection')->where($field, 'like', '%' . $value . '%')->get(); return response()->json($result); }
public function getStore($search) { // May want to clean up search string first $searchStr = $search; // Returns the original Mongo Result $result = DB::collection('food_cards_collection')->where('store.name', 'like', '%' . $searchStr . '%')->get(); return response()->json($result); }
public function run() { DB::collection('users')->delete(); DB::collection('users')->insert(['name' => 'John Doe', 'seed' => true]); }
public function keywords() { $keywords = DB::collection('map_reduce_twitter_words')->orderBy('value', 'desc')->paginate(25); return $this->response->withPaginator($keywords, new KeywordsTransformer()); }
/** * @param string $collectionName * @param string $documentId * @param array $data - [key => val, ...] * @return bool */ public function editDocument($collectionName, $documentId, $data) { $dbResponse = DB::collection($collectionName)->where($documentId)->update($data); return $this->checkResult($dbResponse); }