Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Single item returned instead of full set on select #52

Open
kuamanet opened this issue Jan 17, 2020 · 0 comments
Open

Single item returned instead of full set on select #52

kuamanet opened this issue Jan 17, 2020 · 0 comments

Comments

@kuamanet
Copy link

kuamanet commented Jan 17, 2020

Hello, thanks for the awesome work!

I'm doing this

DB::connection('couchbase')->table(env('DB_DATABASE'))
            ->select('meta(' . env('DB_DATABASE') . ').id as docId, id, blah blah other fields')
            ->whereRaw("aField is null || aSecondField is null")
            ->get();

That should return a big load of records, but is returning just one.
The "code" reason for that is

if (!isset($row->{$this->bucket})) {

and my records are not nested inside a "bucket" key. Is there any particular reason you are doing this check?
And can you confirm I must write my records with a bucket key that wraps the real value if I want to get multiple results from my selects?

Like, say, my bucket is named "db", I need to

$result = \DB::connection('couchbase')
    ->table('testing')->key($key)->insert(['mybucket' => [ /* all my values..*/]]);

?

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant