sdk icon indicating copy to clipboard operation
sdk copied to clipboard

Allow `iterateEntities` to find entities by properties other than just `_type`

Open aiwilliams opened this issue 5 years ago • 4 comments

This would allow folks to avoid writing their own iterators that just filter the matching entities. We can do this in the SDK as-is, inefficient as it may be, but at least when we make it fast, there will be no changes in the integrations.

aiwilliams avatar Apr 24 '20 13:04 aiwilliams

I had to use this for a project once, I think you can make it only do in memory and not persist to a file. Also think it supports defining an index so we could have integration developers provide hints about what properties they'll be filtering by.

It worked well enough.

austin-rausch avatar May 01 '20 18:05 austin-rausch

Thanks for pointing this out @austin-rausch.

we could have integration developers provide hints about what properties they'll be filtering by

That's great.

aiwilliams avatar May 01 '20 19:05 aiwilliams

Looking at the GitLab integration and seeing a lot of cases of building in-memory maps of id => entity.

aiwilliams avatar May 11 '20 12:05 aiwilliams

Recently we implemented getEntity({ _key: string, _type: string }), might be relevant here.

ndowmon avatar Jul 28 '20 16:07 ndowmon