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
          }
        }
      ]
    }
  }
}

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