How to query an array of streams by field values/owner did

Hi Ceramic Team,

We are building a note extension using Ceramic. I want to query one user’s all notes(streams) and query all notes under a list of tags.

For owner did, I only want to get the streams created in my application under this DID. Does that mean I should state my app name in the streams? I noticed that there is a field called family, but I’m not sure it is designed for this use case.

And for finding by tags, is it possible for me to query something like we can in the MongoDB:

db.notes.find( { tags: { $all: [“Ceramic”, “IPFS”] } } )

Can I also limit the range of streams to be queried under my application? For example, only those {public: true} notes.

Thank you,
Monica

Hi, @monicaz :slight_smile: !

Thanks for reaching out!

Glazed doesn’t support lists or filtering out-of-the box. We’re currently working on ComposeDB which is designed to handle indexed composible data graphs.

ComposeDB is not available on Ceramic Mainnet yet, but we encourage you to start building on it on Claynet, if you don’t want to go to production over the next couple of months. ComposeDB will be available on Mainnet in late February.

If you have to work with lists of objects on prod right now, you can consider setting up your own Ceramic node and implementing additional functionality on it, i.e.:

  • indexing all Note documents
  • providing an endpoint to query indexed Node documents

Having said all of that, one of the main goals of Ceramic is to provide the data layer for re-usable and composable data. That means that we strongly encourage re-using data between apps.

There will probably be ways in the future to use ComposeDB to get only data created by your app, but we don’t encourage such use cases and you need to remember that all data created in your app will be available for all apps on Ceramic (unless you implement some additional measures to make it difficult to others to read that data.

Hi @artur,

Thank you very much for answering my question! Yes, I started to research your Compose DB. It’s exciting and I hope everything goes well in your development.

And yes, I now understand that the data in the same data model are shared on Ceramic between different apps. That’s good for a note extension. I’m happy as long as I can get a user’s generated content by his DID in only this data model.

Thank you again.
Monica