Is your feature request related to a problem? Please describe.
At the moment, one indexer can insert data only into one collection. This is mostly fine but:
increases the deployment complexity
makes data eventually consistent.
Describe the solution you'd like
We should introduce a "multi collection" mode for mongo indexers.
Configuration wise, we change the mongo options to allow a single collection (like now) or multiple collections. Like all options, we want this to be configurable from inside the script, but also cli and environment variables. The easiest way is to have two keys: collectionName and collectionNames.
Is your feature request related to a problem? Please describe.
At the moment, one indexer can insert data only into one collection. This is mostly fine but:
Describe the solution you'd like
We should introduce a "multi collection" mode for mongo indexers.
Configuration wise, we change the mongo options to allow a single collection (like now) or multiple collections. Like all options, we want this to be configurable from inside the script, but also cli and environment variables. The easiest way is to have two keys:
collectionName
andcollectionNames
.When users opt into multi-collection mode, the value returned by the transform function is expected to be different.
{ data: any, collection: string }
(data goes indata
, collection specify where to insert data){ entity: any, collection: string, update: any }
(newcollection
property)On chain reorganizations, data from all collections should be invalidated.
Additional context
This feature has been requested by a user and should be prioritized.