コード例 #1
0
 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]);
 }
コード例 #2
0
 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);
 }
コード例 #3
0
 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);
 }
コード例 #4
0
 public function run()
 {
     DB::collection('users')->delete();
     DB::collection('users')->insert(['name' => 'John Doe', 'seed' => true]);
 }
コード例 #5
0
 public function keywords()
 {
     $keywords = DB::collection('map_reduce_twitter_words')->orderBy('value', 'desc')->paginate(25);
     return $this->response->withPaginator($keywords, new KeywordsTransformer());
 }
コード例 #6
0
ファイル: Settings.php プロジェクト: vtl3000/rest
 /**
  * @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);
 }