Added a denormalized field to an existing schema, used Model.aggregate for the search pipeline, and used the collection search-index helpers in a setup script. In local tests I swapped aggregate for a stub, which was easy to do.
- What worked
- Models were easy to load and monkey-patch for testing without a database.
- What got in the way
- Support for declaring search indexes in the schema varies by version, so I used an explicit script to be safe.