Closed edukmattos closed 6 years ago
Hi! I had new tests without the package l5-repository and the same error message. This package only works with couchdb 2.0?
Hi @ecmattos, which version are you using? This package is working with all 2.x versions. This index problem might be related to user permission, usually only admin can create indexes and this library creates index on the fly.
Oi, Robson ! Eu atualizei o meu CouchDB para a versao 2 e funcionou beleza ! Vou testar a autenticações dos usuários e qualquer coisa, peço uma ajuda. Abraçoes
Hi @ecmattos I'm glad you got it sorted. In any further request, please let's keep talking in English so we can help other users which may face the same problem as you.
ok
I Solved with:
curl -X POST -d'{"index":{"fields":["type"]}}' -H 'Content-type: application/json' https://user:password@host.com/database_name/_index
Hi ! Im using this package with l5-reposytory.
When runnig: localhost:8000/states
Im getting an error message below:
(1/1) Exception QueryException no-index or no matching fields order/selector
in Builder.php (line 358)
at Builder->get(array('')) in Builder.php (line 462) at Builder->getModels(array('')) in Builder.php (line 446) at Builder->get() in Model.php (line 1374) at Model->call('get', array()) in Model.php (line 568) at Model->call('get', array()) in StateRepositoryEloquent.php (line 25) at StateRepositoryEloquent->allStates() in StatesController.php (line 29) at StatesController->index() at call_user_func_array(array(object(StatesController), 'index'), array()) in Controller.php (line 55)
StatesController.php <?php
namespace MyApp\Http\Controllers;
use Illuminate\Http\Request;
use MyApp\Http\Requests; use MyApp\Http\Controllers\Controller; use MyApp\Repositories\StateRepository;
class StatesController extends Controller { private $stateRepository;
StateRepositoryEloquent.php <?php
namespace MyApp\Repositories; use MyApp\Models\State; use Prettus\Repository\Eloquent\BaseRepository;
class StateRepositoryEloquent extends BaseRepository implements StateRepository { public function model() { return State::class; }
}
-------------------------------------------------------------------------------------------------------------------------------------------
web.php
Route::group(['prefix' => 'states'], function () { Route::get('/', 'StatesController@index')->name('states'); Route::get('/create', 'StatesController@create')->name('states.create'); Route::get('/{id}/show', 'StatesController@show')->name('states.show'); Route::get('/{id}/edit', 'StatesController@edit')->name('states.edit'); Route::get('/{id}/destroy', 'StatesController@destroy')->name('states.destroy'); Route::put('/{id}/update', 'StatesController@update')->name('states.update'); Route::post('/', 'StatesController@store')->name('states.store'); }); #