Queries by fields

Can I query items by some field

by name or signers

{
  "data": {
    "contractIndex": {
      "edges": [
        {
          "node": {
            "id": "kjzl6kcym7w8y7lw222sviznf2tjcrwsvgby84m3u0wqx3xc0w5axomqqnl9ycl",
            "name": "Contract 1",
            "signers": [
              {
                "id": "did:key:z6Mkjfhf6n2YyvePbNB14jLrKwQQNk6KpVJ1zoa5a72die5Q"
              },
              {
                "id": "did:key:z6MkmR18k9FciQUkbYiCAnLxv1N15ghECKEUVYo4asfMHEdE"
              }
            ],
            "status": null,
            "initiator": {
              "id": "did:key:z6MkjQT5bSB8sMFAFch8ds582BdZupAfxd3M5CC1omSCgtCt"
            },
            "expiry": null
          }
        }
      ]
    }
  }
}
2 Likes

Filtering queries based on specific fields is currently not supported, but it’s under consideration for future releases.

Thanks! In October? with relationships?

It’s not specifically set on the roadmap yet so it won’t be part of the October release for sure.
We’ll have a major release in early 2023 so it could make it by then, but if it doesn’t get prioritized for this release it will be added later.

Thank you! I’ll wait. while I receive data by field on the client

Hey Ivan,

I’m a product manager for Ceramic - I’ve captured your need to query custom fields within model. You can expect Relations on the Developer Preview Oct 7, and then this feature should be coming around November. You’re actually the second person today to mention this feature request so we are prioritizing this as soon as we can!

I will say there’s a bit of a hacky workaround you can try in the meantime

So if you have a backend application server you could also connect directly to the database - there is a postgres JSONB column with all the content from the document. You could add JSONB indexes on specific fields in that content and then query that content directly.

For example:

SELECT *
       FROM kjz_model_table
       WHERE stream_content->'settings'->'dark_mode' = 'true’;

Thanks for your patience! Excited to hear more about what you’re building.

1 Like

Thanks a lot! I will wait

1 Like

Hey Avi,

I am a developer from WhatsCookin’. We are building an application for a client with composedb in mind. And we are also waiting for this feature to be implemented.

Just letting you know.

1 Like

Hey,

I was wondering what’s the status of this feature request. Was this released already?

We at DevNode also would greatly appreciate queries, that would simplify our tech stack by a lot and also help us put more data on Ceramic instead of centralised databases.

I noticed that queries currently only accept first, before and after clauses. I suppose this feature will include a where clause, right?

Thanks!

1 Like

Hey Andrei, this is definitely our top requested feature, but likely arriving in March. We are finishing up some major changes that will allow apps to sync all historical data for a model + stability upgrades. Apologies for the wait and thank you for your patience.

1 Like