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

Collection with name collection can't be properly indexed #509

Open
vikiival opened this issue May 5, 2021 · 4 comments
Open

Collection with name collection can't be properly indexed #509

vikiival opened this issue May 5, 2021 · 4 comments

Comments

@vikiival
Copy link

vikiival commented May 5, 2021

Hey,
I found super strange bug
I have collection in textile called collection

{
    "_id": "0488B1A94FD8D61738-.7KSM",
    "_mod": 1619971087103502600,
    "attributes": [],
    "description": "description",
    "issuer": "CgGKH1dsPgJkQ3caFsnDtMUWUqVJKEpRt1ekM5RDW4UrYhP",
    "name": "Butterflies",
}

and when I want to find collections by issuer like:

const query = new Where('issuer').eq('CgGKH1dsPgJkQ3caFsnDtMUWUqVJKEpRt1ekM5RDW4UrYhP')
const result = await this.client.find(this.store, 'collection', query)

I got empty result

However, when I use this snippet

const collections = await this.client.find(this.store, 'collection', {})
const result = collection.filter({ issuer } => issuer === 'CgGKH1dsPgJkQ3caFsnDtMUWUqVJKEpRt1ekM5RDW4UrYhP')

I got positive result.

I use the same snippet (with where clausule) for collection called nft and it works.

Pls this is super urgent because now I have to make exponential reads on thread db

@sanderpick
Copy link
Member

@carsonfarmer before I look at this... does the issue look related to the local first JS lib, or is it in fact a go-threads issue?

@carsonfarmer
Copy link
Member

No, not a local first issue here. But it could be related to this: textileio/js-textile#1022

@carsonfarmer
Copy link
Member

In both cases though, the results from the remote go-threads daemon are being reported, so this could be a) a issue with the query/where clause, or something funny b) with the query handling in go-threads.

@carsonfarmer
Copy link
Member

Just to update this issue, the issue referenced elsewhere (js-textile) indicates that:

If even a single document in the threadDB doesn't have the specific key that you are querying it returns nothing instead of just skipping that specific document.

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

3 participants